Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

nithinkdb
Copy link
Contributor

We need to allow for parameterized queries to be used in a legacy matter.

@@ -501,6 +502,11 @@ def execute(
"""
if parameters is None:
parameters = []
elif self.thrift_backend._use_legacy_parameters:
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@yunbodeng-db
Copy link
Contributor

Please sign your DCO. It's easy to do it now before you have more commits later.

Copy link
Contributor

@susodapop susodapop left a 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.

@@ -501,6 +502,11 @@ def execute(
"""
if parameters is None:
parameters = []
elif self.thrift_backend._use_legacy_parameters:
Copy link
Contributor

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.

@@ -501,6 +502,11 @@ def execute(
"""
if parameters is None:
parameters = []
elif self.thrift_backend._use_legacy_parameters:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@susodapop
Copy link
Contributor

Closing as we implemented this in #267 with tests.

@susodapop susodapop closed this Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants