Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy committed Nov 16, 2023
1 parent 33f082d commit 9042bf3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions mlflow/deployments/databricks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ def list_deployments(self, endpoint=None):
def get_deployment(self, name, endpoint=None):
raise NotImplementedError

@property
def _host_creds(self):
"""
NB: When `MlflowGatewayClient` is used as an instance variable in a custom pyfunc model, it
is pickled in the environment where the custom pyfunc model is defined (e.g. a notebook).
When the model is moved to a different environment, e.g. model serving, new credentials
need to be resolved from within the new environment. Accordingly, we re-resolve host
credentials every time a request is made.
"""
return get_databricks_host_creds("databricks")

def _call_endpoint(
self,
method: str,
Expand All @@ -46,7 +35,7 @@ def _call_endpoint(
call_kwargs["json"] = json_body

response = http_request(
host_creds=self._host_creds,
host_creds=get_databricks_host_creds("databricks"),
endpoint=f"{prefix}/serving-endpoints" + (f"/{route}" if route else ""),
method=method,
timeout=10,
Expand Down

0 comments on commit 9042bf3

Please sign in to comment.