You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eumiro (via GitHub)" <gi...@apache.org> on 2023/08/16 16:04:35 UTC
[GitHub] [airflow] eumiro opened a new pull request, #33450: Import utc from datetime and normalize its import
eumiro opened a new pull request, #33450:
URL: https://github.com/apache/airflow/pull/33450
Replace `pytz.UTC` with stdlib's `datetime.timezone.utc` and normalize importing of `datetime` in touched files because bare `timezone` could come from other libs too.
There's one pytz-depending file left: `tests/models/test_trigger.py`, that could be replaced by stdlib's `zoneinfo` from Python 3.9 (i.e. when Python 3.8 support is dropped) or we could replace it by the backported pypi version right now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] eumiro commented on pull request #33450: Import utc from datetime and normalize its import
Posted by "eumiro (via GitHub)" <gi...@apache.org>.
eumiro commented on PR #33450:
URL: https://github.com/apache/airflow/pull/33450#issuecomment-1682671301
@uranusjr or we can just leave it this way and once Python 3.8 support is dropped, we switch that file directly to `zoneinfo`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on pull request #33450: Import utc from datetime and normalize its import
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on PR #33450:
URL: https://github.com/apache/airflow/pull/33450#issuecomment-1681561149
I think pytz is implicitly required by some dependencies anyway, so there’s no point moving to the backported zoneinfo now. We can maybe do
```python
try:
from zoneinfo import ZoneInfo
except ImportError:
from pytz import Timezone as ZoneInfo
```
to pre-emptively be ready for the transition when the transitive pytz dependency is dropped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] hussein-awala merged pull request #33450: Import utc from datetime and normalize its import
Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala merged PR #33450:
URL: https://github.com/apache/airflow/pull/33450
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on pull request #33450: Import utc from datetime and normalize its import
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on PR #33450:
URL: https://github.com/apache/airflow/pull/33450#issuecomment-1683417679
Or maybe we can use Pendulum’s timezone support? It’s much too integrated into Airflow at this point I don’t see us dropping it at all.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org