|
8 | 8 | from __future__ import annotations |
9 | 9 |
|
10 | 10 | import asyncio |
| 11 | +import logging |
11 | 12 | from dataclasses import dataclass, field |
12 | 13 | from datetime import datetime, timezone |
13 | 14 | from typing import TYPE_CHECKING, Any |
14 | 15 | from uuid import UUID |
15 | 16 |
|
16 | 17 | import prefect |
| 18 | + |
| 19 | +# Logger for SDK fetcher operations |
| 20 | +logger = logging.getLogger(__name__) |
17 | 21 | from prefect._sdk.models import ( |
18 | 22 | DeploymentInfo, |
19 | 23 | FlowInfo, |
@@ -175,9 +179,7 @@ async def _fetch_work_pool( |
175 | 179 | job_vars_schema: dict[str, Any] = {} |
176 | 180 | base_job_template = work_pool.base_job_template |
177 | 181 | if base_job_template and "variables" in base_job_template: |
178 | | - variables = base_job_template["variables"] |
179 | | - if isinstance(variables, dict): |
180 | | - job_vars_schema = variables |
| 182 | + job_vars_schema = base_job_template["variables"] |
181 | 183 |
|
182 | 184 | return WorkPoolInfo( |
183 | 185 | name=work_pool.name, |
@@ -215,7 +217,7 @@ async def _fetch_work_pools_parallel( |
215 | 217 | results = await asyncio.gather(*tasks, return_exceptions=True) |
216 | 218 |
|
217 | 219 | work_pools: dict[str, WorkPoolInfo] = {} |
218 | | - for name, result in zip(pool_names_list, results, strict=True): |
| 220 | + for name, result in zip(pool_names_list, results): |
219 | 221 | if isinstance(result, BaseException): |
220 | 222 | warnings.append( |
221 | 223 | f"Could not fetch work pool '{name}' - `with_infra()` will not be " |
@@ -316,6 +318,7 @@ async def fetch_sdk_data( |
316 | 318 | errors: list[str] = [] |
317 | 319 |
|
318 | 320 | # Check authentication first |
| 321 | + logger.debug("Checking authentication with Prefect API") |
319 | 322 | await _check_authentication(client) |
320 | 323 |
|
321 | 324 | # Build filters |
@@ -391,7 +394,7 @@ async def fetch_sdk_data( |
391 | 394 |
|
392 | 395 | # If filtering by deployment name, check the full name matches |
393 | 396 | full_name = f"{flow_name}/{dep.name}" |
394 | | - if deployment_names and full_name not in deployment_names: |
| 397 | + if deployment_names and dep.name not in deployment_names: |
395 | 398 | # Only include if the full name matches (filter was by name parts) |
396 | 399 | # Skip if user specified full names and this doesn't match |
397 | 400 | found_match = False |
|
0 commit comments