Closed n-thumann closed 3 months ago
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Attention: Patch coverage is 75.00000%
with 1 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.
Files | Patch % | Lines |
---|---|---|
influxdb_client/client/util/date_utils.py | 75.00% | 1 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Proposed Changes
This PR changes the behavior of
get_date_helper
to preferdatetime.datetime.fromisoformat
overdateutil.parser
in Python 3.11 or higher. According to https://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.Because
ciso
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
pytest tests
completes successfully