Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add possibility to specify default timezone for datetimes without tzinfo #238

Merged
merged 3 commits into from
May 5, 2021

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Apr 29, 2021

Closes #73

Proposed Changes

Added possibility to specify default timezone for datetimes without tzinfo.

It is useful for specify system timezone:

from dateutil.tz import tzlocal

from influxdb_client.client.util import date_utils
from influxdb_client.client.util.date_utils import DateHelper

date_utils.date_helper = DateHelper(timezone=tzlocal())

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • pytest tests completes successfully
  • Commit messages are in semantic format
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2021

Codecov Report

Merging #238 (90639c3) into master (f698030) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #238   +/-   ##
=======================================
  Coverage   91.87%   91.88%           
=======================================
  Files          25       25           
  Lines        2031     2033    +2     
=======================================
+ Hits         1866     1868    +2     
  Misses        165      165           
Impacted Files Coverage Δ
influxdb_client/client/util/date_utils.py 96.29% <100.00%> (+0.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f698030...90639c3. Read the comment docs.

@bednar bednar requested a review from rhajek April 29, 2021 09:26
@bednar bednar marked this pull request as ready for review April 29, 2021 09:26
@bednar bednar force-pushed the feat/default-timezone branch from 44094c0 to 90639c3 Compare April 30, 2021 06:46
@bednar bednar force-pushed the feat/default-timezone branch from 90639c3 to 18712be Compare May 5, 2021 13:13
@bednar bednar merged commit bf1c1df into master May 5, 2021
@bednar bednar deleted the feat/default-timezone branch May 5, 2021 14:38
@bednar bednar added this to the 1.18.0 milestone May 5, 2021
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.

_convert_timestamp assumes passed datetime to be UTC
3 participants