Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check length of PROM_THIRDPARTY_METRICS #516

Merged
merged 1 commit into from
Oct 23, 2024
Merged
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
10 changes: 5 additions & 5 deletions src/kepler_model/cmd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def query(args):
queries = None
if args.thirdparty_metrics != "":
queries = [m for m in available_metrics if args.metric_prefix in m or m in args.thirdparty_metrics]
elif [""] != PROM_THIRDPARTY_METRICS:
elif len(PROM_THIRDPARTY_METRICS) > 0:
queries = [m for m in available_metrics if args.metric_prefix in m or m in PROM_THIRDPARTY_METRICS]
else:
queries = [m for m in available_metrics if args.metric_prefix in m]
Comment on lines +151 to 154
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this condition needed any more since PROM_THIRD.. is a list already ?

Expand Down Expand Up @@ -213,7 +213,7 @@ def extract(args):
# Inject thirdparty_metrics to FeatureGroup
if args.thirdparty_metrics != "":
update_thirdparty_metrics(args.thirdparty_metrics)
elif [""] != PROM_THIRDPARTY_METRICS:
elif len(PROM_THIRDPARTY_METRICS) > 0:
update_thirdparty_metrics(PROM_THIRDPARTY_METRICS)
valid_fg = get_valid_feature_group_from_queries([query for query in query_results.keys() if len(query_results[query]) > 1])
ot, fg = check_ot_fg(args, valid_fg)
Expand Down Expand Up @@ -331,7 +331,7 @@ def train_from_data(args):
# Inject thirdparty_metrics to FeatureGroup
if args.thirdparty_metrics != "":
update_thirdparty_metrics(args.thirdparty_metrics)
elif [""] != PROM_THIRDPARTY_METRICS:
elif len(PROM_THIRDPARTY_METRICS) > 0:
update_thirdparty_metrics(PROM_THIRDPARTY_METRICS)
valid_fg = [fg_key for fg_key in FeatureGroups.keys()]
ot, fg = check_ot_fg(args, valid_fg)
Expand Down Expand Up @@ -423,7 +423,7 @@ def train(args):
# Inject thirdparty_metrics to FeatureGroup
if args.thirdparty_metrics != "":
update_thirdparty_metrics(args.thirdparty_metrics)
elif [""] != PROM_THIRDPARTY_METRICS:
elif len(PROM_THIRDPARTY_METRICS) > 0:
update_thirdparty_metrics(PROM_THIRDPARTY_METRICS)

pipeline_name = default_train_output_pipeline
Expand Down Expand Up @@ -563,7 +563,7 @@ def estimate(args):
# Inject thirdparty_metrics to FeatureGroup
if args.thirdparty_metrics != "":
update_thirdparty_metrics(args.thirdparty_metrics)
elif [""] != PROM_THIRDPARTY_METRICS:
elif len(PROM_THIRDPARTY_METRICS) > 0:
update_thirdparty_metrics(PROM_THIRDPARTY_METRICS)

inputs = args.input.split(",")
Expand Down
Loading