Skip to content

Commit

Permalink
Fix tests to respond to Python 3.12 handling of utcnow in sentry-sdk (#…
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
potiuk committed Oct 14, 2023
1 parent 6b5d369 commit 91581c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def write_version(filename: str = str(AIRFLOW_SOURCES_ROOT / "airflow" / "git_ve
]
sentry = [
"blinker>=1.1",
"sentry-sdk>=0.8.0",
"sentry-sdk>=1.32.0",
]
statsd = [
"statsd>=3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"duration": None,
}

CRUMB_DATE = datetime.datetime(2019, 5, 15)
CRUMB_DATE = datetime.datetime(2019, 5, 15, tzinfo=datetime.timezone.utc)
CRUMB = {
"timestamp": CRUMB_DATE,
"type": "default",
Expand Down

0 comments on commit 91581c4

Please sign in to comment.