-
Notifications
You must be signed in to change notification settings - Fork 100
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
[PECO-1117] Allow legacy codepath for parameterized queries to be used. #241
Conversation
src/databricks/sql/client.py
Outdated
@@ -501,6 +502,11 @@ def execute( | |||
""" | |||
if parameters is None: | |||
parameters = [] | |||
elif self.thrift_backend._use_legacy_parameters: |
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.
I think we need to add unit tests to cover the behavior. Any new code should have unit tests.
What about an app which can connect to different dbrs (thinking of dbt). This new property can serve as a forcing function but the default behaviors should be allow the client code to continue to function. Would you check the server version and decide to use the server support or the old client support of the server does not support it?
If it is going to be addressed in a separate PR, it's fine.
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.
We'll circulate a document internally about this decision. I don't think it should be handled / discussed in the Github code review comments as this isn't great visibility across the team.
Agree that this code should be tested and should not merge without tests.
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.
elif self.thrift_backend._use_legacy_parameters: | |
elif self.thrift_backend._use_inline_params: |
I'd propose naming this as obviously unsafe / inline since legacy
isn't indicative of what the change actually does.
Please sign your DCO. It's easy to do it now before you have more commits later. |
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.
Don't merge this. We'll circulate a document internally so we can have multiple eyes on the design.
src/databricks/sql/client.py
Outdated
@@ -501,6 +502,11 @@ def execute( | |||
""" | |||
if parameters is None: | |||
parameters = [] | |||
elif self.thrift_backend._use_legacy_parameters: |
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.
We'll circulate a document internally about this decision. I don't think it should be handled / discussed in the Github code review comments as this isn't great visibility across the team.
Agree that this code should be tested and should not merge without tests.
src/databricks/sql/client.py
Outdated
@@ -501,6 +502,11 @@ def execute( | |||
""" | |||
if parameters is None: | |||
parameters = [] | |||
elif self.thrift_backend._use_legacy_parameters: |
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.
elif self.thrift_backend._use_legacy_parameters: | |
elif self.thrift_backend._use_inline_params: |
I'd propose naming this as obviously unsafe / inline since legacy
isn't indicative of what the change actually does.
Closing as we implemented this in #267 with tests. |
We need to allow for parameterized queries to be used in a legacy matter.