-
Notifications
You must be signed in to change notification settings - Fork 3k
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): support snapshots in dbt and dbt-cloud #7062
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5f457e4
mark dbt use_identifiers as deprecated
hsheth2 e458732
remove dbt stateful ingestion tests
hsheth2 0c88546
add snapshot test
hsheth2 4ce87b6
support snapshot in dbt core
hsheth2 b083d0f
dbt cloud snapshot support
hsheth2 bd32d71
update tests
hsheth2 d05d24b
Merge branch 'master' into dbt-identifiers
treff7es File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ def extract_dbt_entities( | |
for key, manifest_node in all_manifest_entities.items(): | ||
name = manifest_node["name"] | ||
|
||
if "identifier" in manifest_node and use_identifiers: | ||
if use_identifiers and manifest_node.get("identifier"): | ||
name = manifest_node["identifier"] | ||
|
||
if ( | ||
|
@@ -393,11 +393,6 @@ def load_file_as_json(self, uri: str) -> Any: | |
|
||
def loadManifestAndCatalog( | ||
self, | ||
manifest_path: str, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
catalog_path: str, | ||
sources_path: Optional[str], | ||
use_identifiers: bool, | ||
tag_prefix: str, | ||
) -> Tuple[ | ||
List[DBTNode], | ||
Optional[str], | ||
|
@@ -406,12 +401,12 @@ def loadManifestAndCatalog( | |
Optional[str], | ||
Optional[str], | ||
]: | ||
dbt_manifest_json = self.load_file_as_json(manifest_path) | ||
dbt_manifest_json = self.load_file_as_json(self.config.manifest_path) | ||
|
||
dbt_catalog_json = self.load_file_as_json(catalog_path) | ||
dbt_catalog_json = self.load_file_as_json(self.config.catalog_path) | ||
|
||
if sources_path is not None: | ||
dbt_sources_json = self.load_file_as_json(sources_path) | ||
if self.config.sources_path is not None: | ||
dbt_sources_json = self.load_file_as_json(self.config.sources_path) | ||
sources_results = dbt_sources_json["results"] | ||
else: | ||
sources_results = {} | ||
|
@@ -438,8 +433,8 @@ def loadManifestAndCatalog( | |
all_catalog_entities, | ||
sources_results, | ||
manifest_adapter, | ||
use_identifiers, | ||
tag_prefix, | ||
self.config.use_identifiers, | ||
self.config.tag_prefix, | ||
self.report, | ||
) | ||
|
||
|
@@ -460,13 +455,8 @@ def load_nodes(self) -> Tuple[List[DBTNode], Dict[str, Optional[str]]]: | |
manifest_adapter, | ||
catalog_schema, | ||
catalog_version, | ||
) = self.loadManifestAndCatalog( | ||
self.config.manifest_path, | ||
self.config.catalog_path, | ||
self.config.sources_path, | ||
self.config.use_identifiers, | ||
self.config.tag_prefix, | ||
) | ||
) = self.loadManifestAndCatalog() | ||
|
||
additional_custom_props = { | ||
"manifest_schema": manifest_schema, | ||
"manifest_version": manifest_version, | ||
|
16 changes: 16 additions & 0 deletions
16
metadata-ingestion/tests/integration/dbt/copy-from-sample-dbt.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
# This arg should point at a local copy of https://github.com/hsheth2/sample-dbt, | ||
# after the generation script has been run. | ||
sample_dbt=$1 | ||
|
||
cp $sample_dbt/target_processed/dbt_catalog.json sample_dbt_catalog.json | ||
cp $sample_dbt/target_processed/dbt_manifest.json sample_dbt_manifest.json | ||
cp $sample_dbt/target_processed/dbt_sources.json sample_dbt_sources.json | ||
|
||
# We don't currently test run_results from sample-dbt. | ||
# cp $sample_dbt/target_processed/dbt_run_results.json sample_dbt_run_results.json | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean on dbt cloud we supported Snapshot field earlier or why did you rename it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a set of common fields that we use for models, seeds, and snapshots