Skip to content
Snippets Groups Projects
Verified Commit 4fc32765 authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

fix lint

parent 3aba05ed
No related branches found
No related tags found
1 merge request!59Robust mlflow requests
...@@ -3,9 +3,8 @@ import os ...@@ -3,9 +3,8 @@ import os
from contextlib import contextmanager from contextlib import contextmanager
import mlflow import mlflow
from mlflow.environment_variables import MLFLOW_HTTP_REQUEST_MAX_RETRIES
import requests import requests
from mlflow.environment_variables import MLFLOW_HTTP_REQUEST_MAX_RETRIES
from dan import logger from dan import logger
...@@ -20,6 +19,7 @@ def make_mlflow_request(mlflow_method, *args, **kwargs): ...@@ -20,6 +19,7 @@ def make_mlflow_request(mlflow_method, *args, **kwargs):
logger.error(f"Call to `{str(mlflow_method)}` failed with error: {str(e)}") logger.error(f"Call to `{str(mlflow_method)}` failed with error: {str(e)}")
raise e raise e
def setup_environment(config: dict): def setup_environment(config: dict):
""" """
Get the necessary variables from the config file and put them in the environment variables Get the necessary variables from the config file and put them in the environment variables
...@@ -39,7 +39,9 @@ def setup_environment(config: dict): ...@@ -39,7 +39,9 @@ def setup_environment(config: dict):
# Check max retry setting # Check max retry setting
max_retries = MLFLOW_HTTP_REQUEST_MAX_RETRIES.get() max_retries = MLFLOW_HTTP_REQUEST_MAX_RETRIES.get()
if max_retries and int(max_retries) <= 1: if max_retries and int(max_retries) <= 1:
logger.warning(f"The maximum number of retries for MLflow HTTP requests is set to {max_retries}, which is low. Consider using a higher value.") logger.warning(
f"The maximum number of retries for MLflow HTTP requests is set to {max_retries}, which is low. Consider using a higher value."
)
def logging_metrics( def logging_metrics(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment