Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion metaflow/metaflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
# Feature flag (experimental features that are *explicitly* unsupported)

# Process configs even when using the click_api for Runner/Deployer
CLICK_API_PROCESS_CONFIG = from_conf("CLICK_API_PROCESS_CONFIG", False)
CLICK_API_PROCESS_CONFIG = from_conf("CLICK_API_PROCESS_CONFIG", True)


# PINNED_CONDA_LIBS are the libraries that metaflow depends on for execution
Expand Down
30 changes: 26 additions & 4 deletions metaflow/runner/click_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,22 @@ def _compute_flow_parameters(self):

ds = opts.get("datastore", defaults["datastore"])
quiet = opts.get("quiet", defaults["quiet"])

# Check for environment variables first

is_default = False
config_file = opts.get("config")
if config_file is None:
is_default = True
config_file = defaults.get("config")
# Check if it was set through an environment variable -- we
# don't have click process them here so we need to "fake" it.
env_config_file = os.environ.get("METAFLOW_FLOW_CONFIG")
if env_config_file:
# Convert dict items to list of tuples
config_file = list(json.loads(env_config_file).items())
is_default = False
else:
is_default = True
config_file = defaults.get("config")

if config_file:
config_file = dict(
Expand All @@ -494,8 +505,19 @@ def _compute_flow_parameters(self):
is_default = False
config_value = opts.get("config-value")
if config_value is None:
is_default = True
config_value = defaults.get("config_value")
env_config_value = os.environ.get("METAFLOW_FLOW_CONFIG_VALUE")
if env_config_value:
# Parse environment variable using MultipleTuple logic
loaded = json.loads(env_config_value)
# Convert dict items to list of tuples with JSON-serialized values
config_value = [
(k, json.dumps(v) if not isinstance(v, str) else v)
for k, v in loaded.items()
]
is_default = False
else:
is_default = True
config_value = defaults.get("config_value")

if config_value:
config_value = dict(
Expand Down
Loading