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

Generate localized timestamps in multiindex examples #1426

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

rob-sil
Copy link
Contributor

@rob-sil rob-sil commented Nov 16, 2023

Fixes #1371

Generating example data failed whenever the schema had localized timestamps in the multi index. These datatypes are unique because they can't be set with astype and instead need to be localized with tz_localize. pandera already has the helper functions convert_dtype and convert_dtypes to do this and uses them for a localized timestamp index or a localized timestamp column.

When testing, I noticed that the localized timestamp types weren't getting set properly when generating an empty example.

Copy link

codecov bot commented Nov 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (af0e5c0) 94.23% compared to head (d554e93) 94.23%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1426      +/-   ##
==========================================
- Coverage   94.23%   94.23%   -0.01%     
==========================================
  Files          91       91              
  Lines        6976     6974       -2     
==========================================
- Hits         6574     6572       -2     
  Misses        402      402              

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

Copy link
Collaborator

@cosmicBboy cosmicBboy left a comment

Choose a reason for hiding this comment

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

thanks @rob-sil !

and congrats on your first PR to pandera 🔥🚀

@cosmicBboy cosmicBboy merged commit d89ddaf into unionai-oss:main Dec 4, 2023
55 checks passed
max-raphael pushed a commit to max-raphael/pandera that referenced this pull request Jan 24, 2025
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.

Timezone-aware bug with Multi-Index
2 participants