From da13c36b5e84c23d634d711a39e6013f7cf1dfbd Mon Sep 17 00:00:00 2001 From: Stefan Krawczyk Date: Sat, 16 Nov 2024 12:01:22 -0800 Subject: [PATCH] Adds environment variable to change hamilton config location This is for flexibility in determining where to look for the config file. --- hamilton/telemetry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hamilton/telemetry.py b/hamilton/telemetry.py index 0a9523900..72e317744 100644 --- a/hamilton/telemetry.py +++ b/hamilton/telemetry.py @@ -52,8 +52,8 @@ EXPERIMENT_SERVER = "os_hamilton_experiment_server" TIMEOUT = 2 MAX_COUNT_SESSION = 100 # max number of events collected per python process - -DEFAULT_CONFIG_LOCATION = os.path.expanduser("~/.hamilton.conf") +DEFAULT_CONFIG_URI = os.environ.get("HAMILTON_CONFIG_URI", "~/.hamilton.conf") +DEFAULT_CONFIG_LOCATION = os.path.expanduser(DEFAULT_CONFIG_URI) def _load_config(config_location: str) -> configparser.ConfigParser: