Skip to content

Commit 6697790

Browse files
potiukCloud Composer Team
authored andcommitted
Fix tests to respond to Python 3.12 handling of utcnow in sentry-sdk (#34946)
The sentry-sdk 1.32.0 released on 11th of October fixed handling of utcnow to make it future-compatible with Python 3.12. The breadcrumb timestamp returned was naive and now it is timezone aware with utc specified explicitly as timezone. This broke our tests. The change in sentry that impacted it is getsentry/sentry-python#2415 We use the opportunity also to bump sentry sdk minimum version to be 1.32.0 from very old 0.8.0 (from 2019). Sentry is a service, so they generally always want you to use the latest version, and sentry has very little requirements on its own to cause conflicts (for Python 3.8+ it only requires "certifi" without any specific limitations) GitOrigin-RevId: 91581c4991e0f81ac60c64bbaaf31eb51d65922a
1 parent 759aab9 commit 6697790

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def write_version(filename: str = str(AIRFLOW_SOURCES_ROOT / "airflow" / "git_ve
363363
]
364364
sentry = [
365365
"blinker>=1.1",
366-
"sentry-sdk>=0.8.0",
366+
"sentry-sdk>=1.32.0",
367367
]
368368
statsd = [
369369
"statsd>=3.3.0",

tests/core/test_sentry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"duration": None,
5757
}
5858

59-
CRUMB_DATE = datetime.datetime(2019, 5, 15)
59+
CRUMB_DATE = datetime.datetime(2019, 5, 15, tzinfo=datetime.timezone.utc)
6060
CRUMB = {
6161
"timestamp": CRUMB_DATE,
6262
"type": "default",

0 commit comments

Comments
 (0)