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

feat(ingest): reporting logging tweaks #9835

Merged
merged 2 commits into from
Feb 14, 2024
Merged

feat(ingest): reporting logging tweaks #9835

merged 2 commits into from
Feb 14, 2024

Conversation

hsheth2
Copy link
Collaborator

@hsheth2 hsheth2 commented Feb 14, 2024

These take advantage of stacklevel, which is supported in Python 3.8+.

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

These take advantage of `stacklevel`, which is supported in Python 3.8+.
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Feb 14, 2024
@@ -99,11 +102,19 @@ def report_warning(self, key: str, reason: str) -> None:
warnings.append(reason)
self.warnings[key] = warnings

def warning(self, key: str, reason: str) -> None:
self.report_warning(key, reason)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should report_warning and report_failure eventually be private methods, or do you see a case for putting a warning / failure in the report without logging it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup that's the goal - I want to get rid of direct calls to report_warning and report_failure. A bunch of sources also have helper methods that are basically copies of this warning method, and I want to get rid of those too

def warn(self, log: logging.Logger, key: str, reason: str) -> None:

@hsheth2 hsheth2 merged commit 045c76a into master Feb 14, 2024
54 checks passed
@hsheth2 hsheth2 deleted the reporting-tweaks branch February 14, 2024 19:06
hsheth2 added a commit that referenced this pull request Feb 14, 2024
This is a quick follow up on #9835
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants