Skip to content

Commit

Permalink
Handle KeyError when retrieving current model version number
Browse files Browse the repository at this point in the history
  • Loading branch information
safoinme committed Nov 27, 2024
1 parent 698d145 commit 943cfce
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ def compute_performance_metrics_on_current_data(

# Get model version numbers from Model Control Plane
latest_version = get_step_context().model
current_version = Model(name=latest_version.name, version=target_env)

latest_version_number = latest_version.number
current_version_number = current_version.number

current_version = Model(name=latest_version.name, version=target_env)
try:
current_version_number = current_version.number
except KeyError:
current_version_number = None

if current_version_number is None:
current_version_number = -1
Expand Down

0 comments on commit 943cfce

Please sign in to comment.