Antonio-RiveroMartnez opened a new pull request, #27934: URL: https://github.com/apache/superset/pull/27934
### SUMMARY When applying a time_offset in Advanced Analytics, if the row_limit is too small, data will not be present when the join occurs, so this PR prevent such behavior by not using limit nor offset in the inner query (the shifted one). For example this query shown in the following video has all the records for a period of 10+ years: https://github.com/apache/superset/assets/38889534/8dca8b16-5c05-4b2d-8fd6-67387c8708e7 We can see that the result of shifted queries not always include the same periods than the original query, so when the join gets applied, it won't match some records, thus giving you incorrect output. Original query with limit and sorting:  1 year ago query with limit and sorting:  2 years ago query with limit and sorting:  ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Error: In the following image some datapoints are missing in the shifted columns because they are not part of the result dataframe after sorting and limiting it like the original query.  Fix: Now we can see that the query is able to find the records that belong to those offsets regardless, because it's joining using the complete data.  ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
