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

use try / catch to check if index samples is null #1558

Merged
merged 6 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: spark
name: model_monitor_metric_outputter
display_name: Model Monitor - Metric Outputter
description: Output the computed model monitor metrics.
version: 0.3.10
hawestra marked this conversation as resolved.
Show resolved Hide resolved
version: 0.3.11
is_deterministic: true

code: ../../src/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ def run():

samples_index: List[Row] = None
if args_dict["samples_index"]:
print("Processing samples index.")
samples_index_df = try_read_mltable_in_spark(
args.samples_index, "samples_index"
)
if not samples_index_df:
print("Samples index is empty. Skipping processing of the samples index.")
else:
try:
print("Processing samples index.")
samples_index_df = try_read_mltable_in_spark(
args.samples_index, "samples_index"
)
except Exception as e:
print(f"Samples index is empty. Skipping processing of the samples index. {e}")

if samples_index_df:
samples_index: List[Row] = samples_index_df.collect()
result = merge_dicts(
result, SamplesOutputBuilder(samples_index).get_samples_dict()
Expand Down
Loading