Skip to content

Commit 6feac8d

Browse files
committed
Expanded get_mlflow_host_token() function such that it also checks for tokens in environment variables.
1 parent 13f6660 commit 6feac8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mlflow_export_import/common/mlflow_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def dump_mlflow_info():
1010
mlflow_host = get_mlflow_host()
1111
print(" Real MLflow host:", mlflow_host)
1212
print(" MLFLOW_TRACKING_URI:", os.environ.get("MLFLOW_TRACKING_URI",""))
13+
print(" MLFLOW_TRACKING_TOKEN:", os.environ.get("MLFLOW_TRACKING_TOKEN",""))
1314
print(" DATABRICKS_HOST:", os.environ.get("DATABRICKS_HOST",""))
1415
print(" DATABRICKS_TOKEN:", os.environ.get("DATABRICKS_TOKEN",""))
1516

@@ -22,8 +23,9 @@ def get_mlflow_host():
2223
def get_mlflow_host_token():
2324
""" Returns the host (tracking URI) and token """
2425
uri = os.environ.get("MLFLOW_TRACKING_URI",None)
26+
token = os.environ.get("MLFLOW_TRACKING_TOKEN",None)
2527
if uri is not None and uri != "databricks":
26-
return (uri,None)
28+
return (uri,token)
2729
try:
2830
from mlflow_export_import.common import databricks_cli_utils
2931
profile = os.environ.get("MLFLOW_PROFILE",None)

0 commit comments

Comments
 (0)