From 9042bf3e840bf4796822de904a379700434848c7 Mon Sep 17 00:00:00 2001 From: harupy <17039389+harupy@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:40:34 +0900 Subject: [PATCH] refactor Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> --- mlflow/deployments/databricks/__init__.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/mlflow/deployments/databricks/__init__.py b/mlflow/deployments/databricks/__init__.py index bda0e04488cb7..0e408cfb02550 100644 --- a/mlflow/deployments/databricks/__init__.py +++ b/mlflow/deployments/databricks/__init__.py @@ -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, @@ -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,