You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might break existing users who happened to have a path component in their host parameter
It doesn't carry over to other tooling, e.g. Terraform
What kind of tools are you using to interact with Databricks where you need to use this proxy? E.g. do you use the ApiClient directly or also the CLI itself? Perhaps other custom tools?
If you're using ApiClient directly, you could subclass it and prepend your path prefix, for example:
class ProxyApiClient(ApiClient):
def __init__(self, path_prefix=None, **kwargs):
super().__init__(**kwargs)
self.path_prefix = path_prefix
def get_url(self, path, version=None):
url = super().get_url(path, version)
if self.path_prefix:
o = urlparse(url)
o = o._replace(path=self.path_prefix + o.path)
url = o.geturl()
return url
We interact with Databricks via the CLI directly so we can't modify code unless we fork it. Do you have an idea of a way of implementing this thats acceptable to merge? I could implement it if so
Would this change be more palatable if a DATABRICKS_BASE_URL or something similar was added. This would allow us to support this feature without breaking backcompat, but does seem like a bit of a hack 😅.
if base_url := os.environ.get("DATABRICKS_BASE_URL"): # this would probably be moved to config
self.url = base_url
else:
... original logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is to allow enterprise users who are forced to interact with Databricks via a proxy to set a custom host for ApiClient.
Example
Before
After