-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: presto CI failed test #23666
fix: presto CI failed test #23666
Conversation
Codecov Report
@@ Coverage Diff @@
## master #23666 +/- ##
==========================================
+ Coverage 67.94% 68.08% +0.14%
==========================================
Files 1918 1919 +1
Lines 73890 73956 +66
Branches 8058 8087 +29
==========================================
+ Hits 50204 50356 +152
+ Misses 21625 21528 -97
- Partials 2061 2072 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Hugh, I don't think this is the right solution... if other databases are working fine and just Presto is not quoting the strings then we need to understand why.
@@ -1314,7 +1314,7 @@ def dttm_sql_literal(self, dttm: sa.DateTime, col_type: Optional[str]) -> str: | |||
if sql: | |||
return sql | |||
|
|||
return f'{dttm.strftime("%Y-%m-%d %H:%M:%S.%f")}' | |||
return f"""'{dttm.strftime("%Y-%m-%d %H:%M:%S.%f")}'""" |
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.
This is the wrong place to fix this... the single quotes are a database-specific construction, and adding them should be delegated to the database.
Where is dttm_sql_literal
called? Why are other DBs quoting this correctly but not Presto?
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.
Later this gets wrapped in a text()
clause (see BaseEnginesSpec.get_text_clause
) so the string itself will contain single quotes.
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.
So i was following a pattern i saw in the original dttm_sql_literal
, right now the original is now an override for SqlaTable
queries vs. Query
queries
superset/superset/connectors/sqla/models.py
Line 382 in 976e333
def dttm_sql_literal(self, dttm: DateTime) -> str: |
SUMMARY
forgot to add the tripple quotes needed for presto queries to work for the refactor
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION