AadityaAnand opened a new pull request, #42678:
URL: https://github.com/apache/superset/pull/42678
Summary
This PR fixes an issue where enabling Resample to zero only generated
zero-filled buckets between the first and last data points returned by the
query, rather than across the entire selected query time range.
The implementation propagates the resolved query time boundaries (from_dttm
and to_dttm) into the pandas post-processing resampling step. When zero-fill
resampling is enabled, the resampling now generates buckets for the full query
time range, filling any missing intervals with 0.
Changes
* Pass the resolved query time range (from_dttm and to_dttm) from
QueryObject to the resampling post-processing step.
* Extend zero-fill resampling to cover the entire selected query time range
instead of only the range between existing data points.
* Preserve the existing behavior when no query time range is available.
* Leave all other resampling methods unchanged.
* Add unit tests covering:
* Single data point within the selected time range.
* Missing data at the beginning of the range.
* Missing data at the end of the range.
* Missing data throughout the range.
* Regression case verifying existing behavior when no query time range
is provided.
Root Cause
The existing implementation relied on
pandas.DataFrame.resample(...).asfreq(fill_value=0), which only generates
buckets between the first and last timestamps present in the data. As a result,
leading and trailing gaps within the selected query time range were never
filled.
Testing
* Added unit tests for the new zero-fill behavior.
* Verified backward compatibility when no query time range is supplied.
* Confirmed that non-zero-fill resampling behavior remains unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]