This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 91581c4991 Fix tests to respond to Python 3.12 handling of utcnow in
sentry-sdk (#34946)
91581c4991 is described below
commit 91581c4991e0f81ac60c64bbaaf31eb51d65922a
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Oct 14 19:38:50 2023 +0200
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
https://github.com/getsentry/sentry-python/pull/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)
---
setup.py | 2 +-
tests/core/test_sentry.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index c69fffc7ae..20f422136a 100644
--- a/setup.py
+++ b/setup.py
@@ -363,7 +363,7 @@ rabbitmq = [
]
sentry = [
"blinker>=1.1",
- "sentry-sdk>=0.8.0",
+ "sentry-sdk>=1.32.0",
]
statsd = [
"statsd>=3.3.0",
diff --git a/tests/core/test_sentry.py b/tests/core/test_sentry.py
index ec30fc77ba..085fde8a81 100644
--- a/tests/core/test_sentry.py
+++ b/tests/core/test_sentry.py
@@ -56,7 +56,7 @@ TASK_DATA = {
"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",