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(ingest/sagemaker): Gracefully handle missing model group #12000

Conversation

treff7es
Copy link
Contributor

@treff7es treff7es commented Dec 2, 2024

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Dec 2, 2024
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Dec 2, 2024
Example:
>>> arn = "arn:aws:sagemaker:eu-west-1:123456789:model-package-group/my-model-group"
>>> get_group_name_from_arn(arn)
"my-model-group"
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can use doctest to automatically turn this into a unit test

we have a few examples of this in our codebase already

full_table_name,
f"""Note: table {full_table_name} is an AWS Glue object.
logging.info(
f"""Note: table {full_table_name} is an AWS Glue object. This source does not ingest all metadata for Glue tables.
Copy link
Collaborator

Choose a reason for hiding this comment

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

the """ with newlines will make the subsequent lines have weird indentation

use textwrap.dedent or do something like this

   logging.info(f"""\
Note...
second line
""")

>>> get_group_name_from_arn(arn)
"my-model-group"
"""
logger.info(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
logger.info(
logger.debug(

@datahub-cyborg datahub-cyborg bot added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Dec 2, 2024
@treff7es treff7es merged commit 16a0241 into datahub-project:master Dec 3, 2024
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata pending-submitter-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants