-
Notifications
You must be signed in to change notification settings - Fork 120
Description
A small but annoying issue:
I was facing a slew of warnings of the form DatabricksRetryPolicy is currently bypassed. The CommandType cannot be set.
. In my search for a way to resolve this warning, I found the following helpful line in the changelong (line 21):
Replace retry handling with DatabricksRetryPolicy. This is disabled by default. To enable, set
enable_v3_retries=True
when creatingdatabricks.sql.client
(#182)
It claims that setting enable_v3_retries=True
when creating an sql connection will enable the new retry mechanism. I hoped that this would silence the warning. I added the argument, but the warnings persisted. By digging through the code, I found that the correct form of the argument to set is _enable_v3_retries=True
with an underscore at the beginning, not enable_v3_retries=True
.
After making this change, the warnings have been silenced.
i.e., creating the sql connection this way properly sets the retry policy and silences the warnings:
sql.connect(
server_hostname=hostname,
http_path=http_path,
access_token=token,
_enable_v3_retries=True,
)