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

databricks-cli - AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST' #634

Closed
isamrat28 opened this issue May 3, 2023 · 9 comments · Fixed by astronomer/astro-provider-databricks#40

Comments

@isamrat28
Copy link

isamrat28 commented May 3, 2023

Recently, while executing dbfs ls after installing and setting up the databricks-cli-0.17.6 in command line, I am getting the below error:

Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'

A while back, the databricks-cli was working as expected and this seems to be an issue with the upgraded versions in one of the dependencies urllib3-2.0.1 and/or requests-2.30.0 but not sure though.

Could this be checked on a priority and a fix or work-around to this issue?

@isamrat28 isamrat28 changed the title databricks-cli : AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST' databricks-cli - AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST' May 3, 2023
@yyonm
Copy link

yyonm commented May 3, 2023

Me too I'm geeting the same issue with databricks-cli-0.17.6

Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'

It will be some fix for this issue? or maybe an a work-around?

Thanks. Regards.

@MilanaBorsuk
Copy link

MilanaBorsuk commented May 3, 2023

Calling the following command: databricks secrets list-scopes
getting this error:
Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'

Databricks CLI Version: Version 0.17.6

@jorgetorresvesta
Copy link

Same here.
We were able to work around it by adding the following to requirements.txt in our python script,
urllib3==1.26.15

@hovharpcc
Copy link

Looks like related with urllib3 v2.0.1 which removed deprecated Retry options method_whitelist, (#2086) causing the error.

@bstuddard
Copy link

Similar issue here. Any best guess when the fix will be released?

@BGerwe
Copy link

BGerwe commented May 4, 2023

For what it's worth, I encountered the same issue with databricks-cli-0.17.3. It's the same underlying issue with urllib3, but wanted to clarify that rolling back the CLI version won't fix it.

@bigdatamoore
Copy link

I am having the same issue and this is breaking our deployment pipeline as we are using the databricks cli for that.

@bigdatamoore
Copy link

bigdatamoore commented May 4, 2023

Workaround steps (activate your virtual env first if you have one)

pip uninstall -y urllib3
pip install urllib3==1.26.15

That seemed to do the trick for me fwiw ....

tatiana added a commit to astronomer/astro-provider-databricks that referenced this issue May 5, 2023
Since urllib 2.0 was release, our main branch has been broken in the CI:
  File /Users/tati/Code/astro-provider-databricks/src/astro_databricks/operators/notebook.py, line 236, in _get_api_client
    return ApiClient(
  File /Users/tati/Code/astro-provider-databricks/.nox/test-3-10-airflow-2-5/lib/python3.10/site-packages/databricks_cli/sdk/api_client.py, line 106, in __init__
    method_whitelist=set({'POST'}) | set(Retry.DEFAULT_METHOD_WHITELIST),
AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'

Until there is a new databricks-cli release with this fix:
databricks/databricks-cli#634

We should pin the version of urllib, to avoid this error.
@pietern
Copy link
Contributor

pietern commented May 8, 2023

Thanks for reporting the issue.

We just released version 0.17.7 to PyPI which includes a fix.

@pietern pietern closed this as completed May 8, 2023
tatiana added a commit to astronomer/astro-provider-databricks that referenced this issue May 9, 2023
#40)

Since urllib 2.0 was release, our main branch has been broken in the CI:
  File /Users/tati/Code/astro-provider-databricks/src/astro_databricks/operators/notebook.py, line 236, in _get_api_client
    return ApiClient(
  File /Users/tati/Code/astro-provider-databricks/.nox/test-3-10-airflow-2-5/lib/python3.10/site-packages/databricks_cli/sdk/api_client.py, line 106, in __init__
    method_whitelist=set({'POST'}) | set(Retry.DEFAULT_METHOD_WHITELIST),
AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'

The `databricks-cli` released a fix for this issue:
https://github.com/databricks/databricks-cli/releases/tag/0.17.7
databricks/databricks-cli#634
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants