cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Root cause analysis and Woraround for "Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'&quo...

de-hru
New Contributor III

Root cause analysis and Woraround for "Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'"

---------------------------------------------

Problem

  • When using databricks-cli, starting with 4th of May this error occurs:
    • Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'
  • databricks-cli exits and returns an error

---------------------------------------------

Root cause analysis

databricks-cli depends on requests>=2.17.3

requests depends on urllib3<1.27,>=1.21.1

Collecting urllib3<3,>=1.21.1 (from requests>=2.17.3->databricks-cli)
  Downloading urllib3-2.0.2-py3-none-any.whl (123 kB)

Before 4th of May 2023:

Downloading urllib3-1.26.15-py2.py3-none-any.whl (140 kB)

 -> There is a new(er) release of urllib3

 In urllib3 - 2.0.0 (2023-04-26) we can see: 

"...Removed deprecated Retry options method_whitelist, DEFAULT_REDIRECT_HEADERS_BLACKLIST (#2086)..."

And this is causing the error Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'

---------------------------------------------

Workarounds

Two possible workarounds available until now found:

  • No. 1
    • add urllib3==1.26.15 to requirements.txt
  • No. 2
pip install -U databricks-cli
pip uninstall -y urllib3
pip install urllib3==1.26.15

---------------------------------------------

3 REPLIES 3

Debayan
Esteemed Contributor III
Esteemed Contributor III

Pinning the urllib3 version to "1.26.15" should work fine.

de-hru
New Contributor III

Sure.

That's exactly what I wrote in "Workarounds" 😉

apatel
New Contributor III

For what its worth I can confirm the pinning works. I also pinned the requests package. See my details here as I am using pipelines to handle deployment. I've back linked this issue on the databricks website to this item as well.

https://github.com/microsoft/azdo-databricks/issues/59