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

Rename RefreshableCredentials to SessionCredentials #116

Merged
merged 1 commit into from
May 17, 2023
Merged

Conversation

nfx
Copy link
Contributor

@nfx nfx commented May 17, 2023

Align more with other SDKs

@nfx nfx merged commit 1135557 into main May 17, 2023
2 checks passed
@nfx nfx deleted the rename-session-creds branch May 17, 2023 09:48
nfx added a commit that referenced this pull request May 17, 2023
nfx added a commit that referenced this pull request May 17, 2023
# Version changelog

## 0.1.7

* Added an extensive set of examples ([#113](#113)).
* Fixed broken `dbutils.fs.mount` and `dbutils.fs.updateMount` ([#119](#119)).
* Ignore `.netrc` when sending unauthenticated requests for OAuth handshake ([#108](#108)).
* Make ApiClient more `pyodide` friendly ([#114](#114)).
* Persist token acquired through `external-browser` auth type ([#110](#110)).
* Prototype for notebook-native auth ([#115](#115)).
* Rename `RefreshableCredentials` to `SessionCredentials` ([#116](#116)).
* Use shell for opening `az` cli on Windows ([#117](#117)).
@nfx nfx mentioned this pull request May 17, 2023
nfx added a commit that referenced this pull request May 17, 2023
# Version changelog

## 0.1.7

* Added an extensive set of examples
([#113](#113)).
* Fixed broken `dbutils.fs.mount` and `dbutils.fs.updateMount`
([#119](#119)).
* Ignore `.netrc` when sending unauthenticated requests for OAuth
handshake
([#108](#108)).
* Make ApiClient more `pyodide` friendly
([#114](#114)).
* Persist token acquired through `external-browser` auth type
([#110](#110)).
* Prototype for notebook-native auth
([#115](#115)).
* Rename `RefreshableCredentials` to `SessionCredentials`
([#116](#116)).
* Use shell for opening `az` cli on Windows
([#117](#117)).
@pavs23
Copy link

pavs23 commented May 17, 2023

Hey I think this renaming is causing an issue for me.
It looks like something (probably dbt-databricks) is referencing RefreshableCredentials.

The renaming is not sitting well. I'll have to look to pin the version the previous release of this library - if that's even possible. Is it?

This is my stack trace:

============================== 22:32:36.503152 | 119a39df-6df5-4847-a503-a9d31970ab62 ==============================
�[0m22:32:36.503152 [info ] [MainThread]: Running with dbt=1.5.0
�[0m22:32:36.507753 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'log_cache_events': 'False', 'write_json': 'True', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': '/tmp/tmp-dbt-run-96368-profiles', 'debug': 'False', 'fail_fast': 'False', 'log_path': '/tmp/tmp-dbt-run-96368/logs', 'warn_error': 'None', 'version_check': 'True', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'introspect': 'True', 'log_format': 'default', 'static_parser': 'True', 'target_path': 'None', 'send_anonymous_usage_stats': 'False'}
�[0m22:32:36.508621 [info ] [MainThread]: dbt version: 1.5.0
�[0m22:32:36.510969 [info ] [MainThread]: python version: 3.9.5
�[0m22:32:36.511695 [info ] [MainThread]: python path: /local_disk0/.ephemeral_nfs/cluster_libraries/python/bin/python
�[0m22:32:36.512418 [info ] [MainThread]: os info: Linux-5.15.0-1035-aws-x86_64-with-glibc2.31
�[0m22:32:36.514379 [info ] [MainThread]: Using profiles.yml file at /tmp/tmp-dbt-run-96368-profiles/profiles.yml
�[0m22:32:36.515115 [info ] [MainThread]: Using dbt_project.yml file at /tmp/tmp-dbt-run-96368/dbt_project.yml
�[0m22:32:36.515846 [info ] [MainThread]: Configuration:
�[0m22:32:38.647848 [error] [MainThread]: Encountered an error:
cannot import name 'RefreshableCredentials' from 'databricks.sdk.oauth' (/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/oauth.py)
�[0m22:32:38.654170 [error] [MainThread]: Traceback (most recent call last):
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/cli/requires.py", line 86, in wrapper
    result, success = func(*args, **kwargs)
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/cli/requires.py", line 71, in wrapper
    return func(*args, **kwargs)
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/cli/main.py", line 417, in debug
    results = task.run()
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/task/debug.py", line 110, in run
    self.test_configuration()
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/task/debug.py", line 294, in test_configuration
    profile_status = self._load_profile()
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/task/debug.py", line 254, in _load_profile
    profile: Profile = Profile.render(
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/config/profile.py", line 436, in render
    return cls.from_raw_profiles(
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/config/profile.py", line 401, in from_raw_profiles
    return cls.from_raw_profile_info(
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/config/profile.py", line 355, in from_raw_profile_info
    credentials: Credentials = cls._credentials_from_profile(
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/config/profile.py", line 165, in _credentials_from_profile
    cls = load_plugin(typename)
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/adapters/factory.py", line 202, in load_plugin
    return FACTORY.load_plugin(name)
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/adapters/factory.py", line 57, in load_plugin
    mod: Any = import_module("." + name, "dbt.adapters")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/adapters/databricks/__init__.py", line 1, in <module>
    from dbt.adapters.databricks.connections import DatabricksConnectionManager  # noqa
  File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/dbt/adapters/databricks/connections.py", line 54, in <module>
    from databricks.sdk.oauth import OAuthClient, RefreshableCredentials
ImportError: cannot import name 'RefreshableCredentials' from 'databricks.sdk.oauth' (/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/oauth.py)

�[0m22:32:38.655923 [debug] [MainThread]: Command `dbt debug` failed at 22:32:38.655685 after 2.17 seconds
�[0m22:32:38.657730 [debug] [MainThread]: Flushing usage events

@jodmoreira
Copy link

It breakes dbt init command
ImportError: cannot import name 'RefreshableCredentials' from 'databricks.sdk.oauth'

@pavs23
Copy link

pavs23 commented May 20, 2023

Hi @jodmoreira, which client are you using?
If you're using dbt-databricks then please bump to 1.5.2 which pins databricks-sdk-py to 0.1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants