- Notifications
You must be signed in to change notification settings - Fork126
Named parameters support#200
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
7672e59cac1da0d68f8cd6d11a1d8d3b3e819fe0db4a1c59dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -14,7 +14,7 @@ | ||
| CursorAlreadyClosedError, | ||
| ) | ||
| from databricks.sql.thrift_backend import ThriftBackend | ||
| from databricks.sql.utils import ExecuteResponse, ParamEscaper | ||
| from databricks.sql.types import Row | ||
| from databricks.sql.auth.auth import get_python_sql_connector_auth_provider | ||
| from databricks.sql.experimental.oauth_persistence import OAuthPersistence | ||
| @@ -482,21 +482,17 @@ def _handle_staging_remove(self, presigned_url: str, headers: dict = None): | ||
| ) | ||
| def execute( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. If we allowed users to do this I think we should continue to support it, but instead of injecting the parameter values in the driver we should convert to the format expected by the backend and pass it on. | ||
| self, operation: str, parameters: Optional[Dict[str,Any]] = None | ||
| ) -> "Cursor": | ||
| """ | ||
| Execute a query and wait for execution to complete. | ||
| Named parametersshould be given inthisformat: :param. | ||
| For example: | ||
| operation = "SELECT * FROM table WHERE field =:some_param" | ||
| parameters = {"some_param": "foo"} | ||
| Will result in the querywith the parameterssent to the server for server-side parameterization | ||
| :returns self | ||
| """ | ||
| self._check_not_closed() | ||
| self._close_and_clear_active_result_set() | ||
| @@ -507,6 +503,7 @@ def execute( | ||
| max_bytes=self.buffer_size_bytes, | ||
| lz4_compression=self.connection.lz4_compression, | ||
| cursor=self, | ||
| parameters=parameters, | ||
| use_cloud_fetch=self.connection.use_cloud_fetch, | ||
| ) | ||
| self.active_result_set = ResultSet( | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.