Repository navigation
fix(dataset): convert DECIMAL epoch columns with their epoch unit - #46667
Open
SEPURI-SAI-KRISHNA wants to merge 1 commit into
Open
SEPURI-SAI-KRISHNA wants to merge 1 commit into
SEPURI-SAI-KRISHNA wants to merge 1 commit into
Conversation
An epoch stored as DECIMAL or NUMERIC comes back as Decimal objects, which pd.Timestamp rejects, so every query that returned the column as is failed with 500. Turn those values into numbers and convert them like an integer epoch.
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46667 +/- ##
=======================================
Coverage 86.23% 86.23%
=======================================
Files 3146 3146
Lines 220018 220021 +3
Branches 52110 52111 +1
=======================================
+ Hits 189725 189730 +5
+ Misses 26823 26822 -1
+ Partials 3470 3469 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Fixes #46666.
An epoch column stored as
DECIMALorNUMERICcomes back asDecimalobjects in an object column.
_process_datetime_columnapplies the epoch unitonly to numeric dtypes and sends everything else to
pd.Timestamp, which raisesTypeErrorfor aDecimal. Any query that returns the column as is fails with500: a table chart that shows it, filter values on it, and Samples and Drill to
detail on the whole dataset.
An object column holding
Decimalvalues is now turned into numbers first, soit goes through the same
pd.to_datetime(unit=...)call as aBIGINTepoch.Columns that already come back as timestamps are unchanged.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
POST /api/v1/chart/datawithresult_type: sampleson a DuckDB table withts_dec DECIMAL(18,0)andts_big BIGINT, bothepoch_sand holding the samevalues:
TESTING INSTRUCTIONS
One case each for
epoch_s,epoch_msandepoch_us, with a null and half asecond in the values. All three fail on master.
ADDITIONAL INFORMATION