-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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: Pre-query normalization with custom SQL #30389
fix: Pre-query normalization with custom SQL #30389
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #30389 +/- ##
===========================================
+ Coverage 60.48% 83.89% +23.41%
===========================================
Files 1931 533 -1398
Lines 76236 38519 -37717
Branches 8568 0 -8568
===========================================
- Hits 46114 32317 -13797
+ Misses 28017 6202 -21815
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@michael-s-molina I'm trying to understand when this would happen. Could this have something to do with |
@villebro This happens when your engine spec has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix LGTM, although I'm not convinced that method should be there in the first place. I'd almost prefer to follow Elon's "delete, delete, delete" mantra here and remove the whole method instead of fixing this bug, but in the interest of stabilizing the codebase maybe not right now. However, maybe we could start using some convention for annotating code that should be removed/cleaned up during breaking windows? If we don't start cleaning up stuff like this we'll never get out of the tech debt hole we're in..
@villebro We generally use the |
Good point, we can reuse that even for non-public methods. I'll keep that in mind in subsequent PRs 👍 |
(cherry picked from commit ad29985)
SUMMARY
This PR fixes an issue with pre-query normalization when dealing with custom SQL. Previously, a custom SQL that had a label that does not match any column name would throw the following error:
Given function docs:
We simply skip the conversion of custom SQL types as we cannot determine if they are temporal or not currently.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2024-09-25.at.14.13.47.mov
TESTING INSTRUCTIONS
Repro the steps shown in the video using a db engine spec with
allows_subqueries = False
ADDITIONAL INFORMATION