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-#419: Handle incompatibility issues between timedelta64 dtypes with Altair #444

Merged
merged 5 commits into from
Jan 22, 2022

Conversation

cgarciae
Copy link
Contributor

@cgarciae cgarciae commented Jan 13, 2022

Overview

Fixes #419 by handling timedelta64 columns in sanitize_dataframe.

Changes

  • Adds tests for the timedelta64 and interval dtypes.
  • Converts timedelta64 columns to dt.seconds inside the sanitize_dataframe function.

@cgarciae cgarciae marked this pull request as draft January 13, 2022 18:24
@cgarciae cgarciae marked this pull request as ready for review January 13, 2022 21:27
@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #444 (2f58d94) into master (4c95211) will decrease coverage by 0.02%.
The diff coverage is 78.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #444      +/-   ##
==========================================
- Coverage   65.63%   65.60%   -0.03%     
==========================================
  Files          55       55              
  Lines        4423     4440      +17     
==========================================
+ Hits         2903     2913      +10     
- Misses       1520     1527       +7     
Impacted Files Coverage Δ
lux/executor/PandasExecutor.py 89.09% <57.14%> (-0.76%) ⬇️
lux/vislib/altair/AltairChart.py 84.61% <85.71%> (-0.64%) ⬇️
lux/utils/date_utils.py 90.24% <88.88%> (-0.67%) ⬇️
lux/vislib/altair/Heatmap.py 93.10% <0.00%> (-3.45%) ⬇️
lux/vislib/altair/ScatterChart.py 93.93% <0.00%> (-3.04%) ⬇️

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 4c95211...2f58d94. Read the comment docs.

@cgarciae cgarciae changed the title [WIP] Handle incompatibility issues between timedelta64 dtypes with Altair Handle incompatibility issues between timedelta64 dtypes with Altair Jan 14, 2022
@cgarciae cgarciae requested a review from dorisjlee January 14, 2022 15:32
Copy link
Member

@dorisjlee dorisjlee left a comment

Choose a reason for hiding this comment

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

This looks good, can we indicate on the visualization labels that the attribute is now "attr [secs]"?

@dorisjlee dorisjlee changed the title Handle incompatibility issues between timedelta64 dtypes with Altair FIX-#419: Handle incompatibility issues between timedelta64 dtypes with Altair Jan 14, 2022
@cgarciae
Copy link
Contributor Author

@dorisjlee what is the best way to do this? Is it just changing the column name or something more fancy?

@dorisjlee
Copy link
Member

We can do this the same way we set an axis title like we do for the Histogram "axis_name (binned)" for Altair and Matplotlib (see example source).

@dorisjlee dorisjlee merged commit a7e2cf7 into master Jan 22, 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.

ValueError: Field "duration" has type "timedelta64[ns]" which is not supported by Altair.
2 participants