-
Notifications
You must be signed in to change notification settings - Fork 364
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
[Trino] Table/database names starting with digit should inclosed with double quotes #3735
base: master
Are you sure you want to change the base?
Conversation
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.
LGTM!
@@ -90,21 +87,24 @@ def get_auth_password(self): | |||
else DEFAULT_AUTH_PASSWORD.get() | |||
) | |||
|
|||
def _format_database(self, database): | |||
parts = database.split('.') | |||
database = '"' + '"."'.join(parts) + '"' |
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.
Shouldn't we make sure only formats it once? I.e. not if it's already formatted..
def _get_select_query(self, database, table, column=None, operation=None, limit=100): | ||
if operation == 'hello': | ||
statement = "SELECT 'Hello World!'" | ||
else: | ||
column = '%(column)s' % {'column': column} if column else '*' | ||
database = self._format_database(database) | ||
column = '"%(column)s"' % {'column': column} if column else '*' |
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.
Same.
statement = textwrap.dedent('''\ | ||
SELECT %(column)s | ||
FROM %(database)s.%(table)s | ||
FROM %(database)s."%(table)s" |
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.
And here.
import time | ||
import logging |
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 seems not using anywhere in the file
@@ -47,7 +45,7 @@ def decorator(*args, **kwargs): | |||
except RestException as e: | |||
try: | |||
message = force_unicode(json.loads(e.message)['errors']) | |||
except: | |||
except Exception as e: |
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.
Should this change the character to not shadowed by the previous exception, like Exception as ex
?
This PR is stale because it has been open 45 days with no activity and is not labeled "Prevent stale". Remove "stale" label or comment or this will be closed in 10 days. |
What changes were proposed in this pull request?
How was this patch tested?