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

MINOR - Clean topology & add tests #14527

Merged
merged 6 commits into from
Dec 29, 2023

Conversation

pmbrull
Copy link
Collaborator

@pmbrull pmbrull commented Dec 29, 2023

Describe your changes:

Fixes

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

@pmbrull pmbrull requested a review from a team as a code owner December 29, 2023 13:09
@github-actions github-actions bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Dec 29, 2023
post_process: the name of the post_process step
"""
if post_process == "mark_tables_as_deleted" and not self.context.database:
raise ValueError("No Database found in `self.context`")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this logic should not be here, moved it to the database_service class itself

@@ -71,72 +67,118 @@ class TopologyRunnerMixin(Generic[C]):
context: TopologyContext
metadata: OpenMetadata

# The cache will have the shape {`child_stage.type_`: {`name`: `hash`}}
cache = defaultdict(dict)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

using this cache dict instead of relying on the context to keep things clean

cache_all: bool = (
False # If we need to cache all values being yielded in the context
# Required fields to define the yielded entity type and the function processing it
type_: Type[T] = Field(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

using pydantic descriptions instead of comments

cache_all=True,
clear_cache=True,
store_all_in_context=True,
clear_context=True,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated names to separate goals from context & cache

Copy link

Quality Gate Passed Quality Gate passed for 'open-metadata-ingestion'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
92.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@pmbrull pmbrull merged commit f4bbca3 into open-metadata:main Dec 29, 2023
@pmbrull pmbrull deleted the airflow-bkend-patch branch December 29, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ingestion safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants