Repository navigation
Fix timezone issue for ingestion - #647
FlorianBracq wants to merge 2 commits into
Conversation
0cba41e to
b9cc656
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Comparing the naive cached timestamp with a timezone-aware timestamp raises a TypeError on the second resource lookup, breaking even the first file or stream ingestion.
1 open issue
What changed in this PR
This PR updates the ingestion SDK’s timestamp handling to use timezone-aware UTC and address Python 3.12+ datetime.utcnow() deprecation warnings.
Changes:
- Uses timezone-aware UTC for blob ingestion message creation timestamps.
- Updates resource refresh comparisons and authorization-cache timestamps to use timezone-aware UTC.
| File | Description |
|---|---|
| azure-kusto-ingest/azure/kusto/ingest/ingestion_blob_info.py | Adds UTC timezone information to ingestion message creation timestamps. |
| azure-kusto-ingest/azure/kusto/ingest/_resource_manager.py | Updates refresh comparisons and authorization-cache timestamp handling. |
Review effort: Max
b9cc656 to
3fd5c48
Compare
Keep resource cache writes and comparisons in aware UTC. Cover successive resource lookups and cache-expiry boundaries, verify UTC ingestion message serialization, and format the PR changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6f4a536a-7f7a-4d39-b60e-96db0cb49c1c
There was a problem hiding this comment.
🟡 Changes recommended
The authorization-context timestamp changes lack deterministic reuse and expiry tests, leaving potential timezone mismatches and missed hourly refreshes undetected.
1 open issue
1 resolved since last review
Review effort: Max
|
Superseded by #668, a same-repository PR from aasavbadera/timezone-issue into master. The replacement preserves the original contribution and previous fixes, adds the requested authorization-cache UTC/reuse/expiry tests, and removes the fork restriction on authenticated E2E CI. |


When using pyhon >= 3.12, DeprecationWarning are visible with messages such as:
Fixed
Replace datetime.utcnow() with datetime.now(tz=dt.timezone.utc)