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

refactor(ingest): Minor cleanup of File, CsvEnricher, BusinessGlossary, and FileLineage sources #7718

Merged
merged 7 commits into from
Mar 31, 2023

Conversation

asikowitz
Copy link
Collaborator

A few followups to #7552, + some modernization of the sources, with auto_workunit_reporter.

Refactoring got the most complicated on the file lineage source but logic should still be the same, sorry if it's a difficult review.

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 Mar 30, 2023
@@ -102,6 +103,9 @@ class CSVEnricherSource(Source):
be applied at the entity field. If a subresource IS populated (as it is for the second and third rows), glossary
terms and tags will be applied on the subresource. Every row MUST have a resource. Also note that owners can only
be applied at the resource level and will be ignored if populated for a row with a subresource.

:::note
This source will not work on very large csv files that do not fit in memory.
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think you need a trailing ::: as well

T = TypeVar("T", bound=WorkUnit)


def auto_workunit_reporter(report: SourceReport, stream: Iterable[T]) -> Iterable[T]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would love to get to a point where sources can also generate MCPs and MCEs directly, and the helper wraps them into WorkUnits as necessary

Copy link
Contributor

@aditya-radhakrishnan aditya-radhakrishnan left a comment

Choose a reason for hiding this comment

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

LGTM!

@asikowitz asikowitz merged commit de587b2 into datahub-project:master Mar 31, 2023
@asikowitz asikowitz deleted the remote-file-read-cleanup branch March 31, 2023 22:49
yoonhyejin pushed a commit that referenced this pull request Apr 3, 2023
…y, and FileLineage sources (#7718)

- Adds auto_workunit_reporter to each source
- Standardizes comments around remote paths
- Adds back AuditStamp to FileLineage source
- Some generic refactoring
hsheth2 added a commit to hsheth2/datahub that referenced this pull request Apr 4, 2023
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.

3 participants