Skip to content

fix: Add more logging when unexpected number of artifacts found #3065

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

Merged
merged 1 commit into from
Apr 19, 2022
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
21 changes: 18 additions & 3 deletions tests/integ/sagemaker/lineage/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,12 @@ def static_endpoint_context(sagemaker_session, static_pipeline_execution_arn):
contexts = sagemaker_session.sagemaker_client.list_contexts(SourceUri=endpoint_arn)[
"ContextSummaries"
]
if len(contexts) != 1:

logging.info(f"Found {len(contexts)} contexts associated with {endpoint_arn}")
for ctx in contexts:
logging.info(f'Found context "{ctx["ContextArn"]}"')

if len(contexts) == 0:
raise (
Exception(
f"Got an unexpected number of Contexts for \
Expand All @@ -689,7 +694,12 @@ def static_model_package_group_context(sagemaker_session, static_pipeline_execut
contexts = sagemaker_session.sagemaker_client.list_contexts(SourceUri=model_package_group_arn)[
"ContextSummaries"
]
if len(contexts) != 1:

logging.info(f"Found {len(contexts)} contexts associated with {model_package_group_arn}")
for ctx in context:
logging.info(f'Found context "{ctx["ContextArn"]}"')

if len(contexts) == 0:
raise (
Exception(
f"Got an unexpected number of Contexts for \
Expand All @@ -713,7 +723,12 @@ def static_model_artifact(sagemaker_session, static_pipeline_execution_arn):
artifacts = sagemaker_session.sagemaker_client.list_artifacts(SourceUri=model_package_arn)[
"ArtifactSummaries"
]
if len(artifacts) != 1:

logging.info(f"Found {len(artifacts)} artifacts associated with {model_package_arn}")
for art in artifacts:
logging.info(f'Found artifact {art["ArtifactArn"]}')

if len(artifacts) == 0:
raise (
Exception(
f"Got an unexpected number of Artifacts for \
Expand Down