Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

perf: Prefer datetime.fromisoformat over dateutil.parse in Python 3.11+#657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

n-thumann
Copy link
Contributor

@n-thumannn-thumann commentedMay 18, 2024
edited
Loading

Proposed Changes

This PR changes the behavior ofget_date_helper to preferdatetime.datetime.fromisoformat overdateutil.parser in Python 3.11 or higher.
According tohttps://github.com/closeio/ciso8601/blob/b17984f5b4c6db0ef596b4d31456c8a39ae278ee/why_ciso8601.md,Since Python 3.11+, the performance of cPython's datetime.fromisoformat is now very good. I did some quick testing and it seems to be on a par withciso8601:
On Python 3.10 I've got ~37,5s and ~3,5s without and withciso8601 installed, respectively. On Python 3.11 I've got ~2,5s and ~2,6s without and withciso8601 installed, respectively.

Becauseciso is no dependency, but an extra, not all users (including me) installed it. With this PR these users will get a better out-of-the-box performance for Python 3.11+ users.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • pytest tests completes successfully
  • Commit messages areconventional
  • SignCLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commentedMay 18, 2024
edited
Loading

⚠️ Please install the'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is75.00000% with1 line in your changes missing coverage. Please review.

Project coverage is 90.40%. Comparing base(d2393e0) to head(b97b611).
Report is 9 commits behind head on master.

FilesPatch %Lines
influxdb_client/client/util/date_utils.py75.00%1 Missing⚠️

❗ Your organization needs to install theCodecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@##           master     #657      +/-   ##==========================================- Coverage   90.42%   90.40%   -0.03%==========================================  Files          39       39                Lines        3510     3513       +3     ==========================================+ Hits         3174     3176       +2- Misses        336      337       +1

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

@n-thumannn-thumannforce-pushed theprefer_datetime_over_dateutil_python_3_11 branch from91eeb51 to9232a81CompareMay 18, 2024 23:16
@n-thumannn-thumann changed the titleImprove performance in Python 3.11+ without ciso6801 extraperf: prefer datetime.fromisoformat over dateutil.parse in Python 3.11+May 18, 2024
@n-thumannn-thumann changed the titleperf: prefer datetime.fromisoformat over dateutil.parse in Python 3.11+perf: Prefer datetime.fromisoformat over dateutil.parse in Python 3.11+May 18, 2024
@n-thumannn-thumannforce-pushed theprefer_datetime_over_dateutil_python_3_11 branch from9232a81 to46f4f7eCompareMay 18, 2024 23:21
@bednarbednar added this to the1.44.0 milestoneMay 20, 2024
@bednarbednar self-assigned thisMay 20, 2024
Copy link
Contributor

@bednarbednar left a comment

Choose a reason for hiding this comment

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

@n-thumann, thank you for your fantastic PR! 👍

LGTM 🚀

@bednarbednar merged commit73849e7 intoinfluxdata:masterMay 20, 2024
15 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@bednarbednarbednar approved these changes

Assignees

@bednarbednar

Labels
None yet
Projects
None yet
Milestone
1.44.0
Development

Successfully merging this pull request may close these issues.

3 participants
@n-thumann@codecov-commenter@bednar

[8]ページ先頭

©2009-2025 Movatter.jp