-
Notifications
You must be signed in to change notification settings - Fork 234
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
Pass existing server_side_parameters to session connection wrapper and use to configure SparkSession. #691
Conversation
…d use to configure SparkSession.
dbt/adapters/spark/connections.py
Outdated
@@ -449,7 +449,7 @@ def open(cls, connection): | |||
SessionConnectionWrapper, | |||
) | |||
|
|||
handle = SessionConnectionWrapper(Connection()) | |||
handle = SessionConnectionWrapper(Connection(), creds.server_side_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 would rather pass this in the Connection
constructor.
handle = SessionConnectionWrapper(Connection(), creds.server_side_parameters) | |
handle = SessionConnectionWrapper(Connection(creds.server_side_parameters)) |
And then the connection can pass it down to the constructor of the Cursor
. The config doesn't change between .execute()
calls, so I think it makes more sense to pass it in the constructors.
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.
@Fokko I haven't tested this, but is the new code what you had in mind?
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.
@alarocca-apixio That's exactly what I had in mind, thanks!
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 just gave this a swing locally, and it works like a charm! Thanks @alarocca-apixio for picking this up
Prefer PR #823 823 |
resolves #690
Description
Pass existing server_side_parameters to session connection wrapper and use to configure SparkSession.
Checklist
changie new
to create a changelog entry