Skip to content

Commit f96f5e7

Browse files
kbighorseclaude
andcommitted
chore: move datetime imports to module level, add logger.warning for NULL AnalysisDate
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c265328 commit f96f5e7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

transfers/backfill/chemistry_backfill.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from __future__ import annotations
2626

2727
from dataclasses import dataclass, field
28-
from datetime import timezone
28+
from datetime import date as date_type, datetime, time, timezone
2929

3030
from sqlalchemy import select
3131
from sqlalchemy.dialects.postgresql import insert as pg_insert
@@ -399,13 +399,14 @@ def _backfill_minor_trace_chemistry_impl(session: Session) -> BackfillResult:
399399
# so rows without AnalysisDate must be skipped.
400400
obs_dt = row.analysis_date
401401
if obs_dt is None:
402+
logger.warning(
403+
"Row GlobalID=%s has no AnalysisDate — skipping", global_id_str
404+
)
402405
result.errors.append(
403406
f"Row GlobalID={global_id_str} has no AnalysisDate — skipping"
404407
)
405408
continue
406409

407-
from datetime import date as date_type, datetime, time
408-
409410
if isinstance(obs_dt, datetime):
410411
if obs_dt.tzinfo is None:
411412
obs_dt = obs_dt.replace(tzinfo=timezone.utc)

0 commit comments

Comments
 (0)