Skip to content

Remove deprecated use of dateutil.zoneinfo - #1392

Open
pganssle wants to merge 1 commit into
arrow-py:masterfrom
pganssle:remove_dateutil_zoneinfo
Open

pganssle wants to merge 1 commit into
arrow-py:masterfrom
pganssle:remove_dateutil_zoneinfo

Conversation

@pganssle

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

  • [-] 🧪 Added tests for changed code. N/A
    -[x] 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • 🧹 All linting checks pass when run locally (run tox -e lint or make lint to find out!).
  • [-] 📚 Updated documentation for changed code. N/A
  • ⏩ Code is up-to-date with the master branch.

Description of Changes

dateutil.zoneinfo is deprecated in version 3.0+, but it turns out that this test is not actually using dateutil in any meaningful way, because it takes the union of the dateutil zones and the zoneinfo zones, and then discards all the ones that are not in the zoneinfo set, which is equivalent to just using the zoneinfo zones directly.

So, I've simply removed the deprecated zoneinfo usage.

`dateutil.zoneinfo` is deprecated in version 3.0+, but it turns out that
this test is not actually *using* dateutil in any meaningful way,
because it takes the union of the dateutil zones and the zoneinfo zones,
and then discards all the ones that are not in the zoneinfo set, which
is equivalent to just using the zoneinfo zones directly.

So, I've simply removed the deprecated zoneinfo usage.
Comment thread tests/utils.py
def make_full_tz_list():
dateutil_zones = set(get_zonefile_instance().zones)
zoneinfo_zones = set(zoneinfo.available_timezones())
# Since the tests create ZoneInfo objects, we can only use timezones

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you would prefer that I remove this comment, it's mostly not relevant now that there's no other option to contrast it with.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2224255) to head (6f891d0).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1392   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2315      2315           
  Branches       358       358           
=========================================
  Hits          2315      2315           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant