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

fix tz deprecation #972

Merged

Conversation

cristianmatache
Copy link
Contributor

fixes #971

@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 96.69% // Head: 96.76% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (2412a61) compared to base (914d493).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #972      +/-   ##
==========================================
+ Coverage   96.69%   96.76%   +0.07%     
==========================================
  Files          42       42              
  Lines        4201     4231      +30     
==========================================
+ Hits         4062     4094      +32     
+ Misses        139      137       -2     
Impacted Files Coverage Δ
pandera/typing/__init__.py 100.00% <ø> (ø)
pandera/engines/pandas_engine.py 97.48% <100.00%> (+0.50%) ⬆️
pandera/strategies.py 98.26% <100.00%> (+0.01%) ⬆️
pandera/extensions.py 100.00% <0.00%> (ø)
pandera/decorators.py 98.90% <0.00%> (+0.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cosmicBboy
Copy link
Collaborator

@cristianmatache
Copy link
Contributor Author

thanks @cristianmatache! mind adding a test for this in https://github.com/unionai-oss/pandera/blob/master/tests/core/test_dtypes.py ?

yes sir

and pandas_dtype.tz is not None
and col.dt.tz is None
):
col = col.dt.tz_localize(pandas_dtype.tz)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@cristianmatache can we add a test case that executes this conditional? i.e. a case where the schema dtype is timezone aware but the data column isn't?

Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
Signed-off-by: Niels Bantilan <[email protected]>
@cosmicBboy cosmicBboy merged commit 7bd106e into unionai-oss:master Oct 31, 2022
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.

Pandas deprecated (timezone naive timestamp).astype(timezone aware dtype)
2 participants