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/dbt): check for nodes key before accessing #7462

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

khgouldy
Copy link
Contributor

@khgouldy khgouldy commented Mar 1, 2023

fix(manifest-parser): checks to ensure nodes key is present

dbt's manifest file can have seeds that list a depends_on key without the nodes key. this change checks to ensure the nodes key is present before appending to the upstream_nodes list. Example node from our dbt project:

{seed.***.customer:{'database': '***', 'schema': '***', 'name': 'customer', 'resource_type': 'seed', 'package_name': '***', 'path': 'customer.csv', 'original_file_path': 'seeds/customer.csv', 'unique_id': 'seed.***.customer', 'fqn': ['***', 'customer'], 'alias': 'customer', 'checksum': {'name': 'sha256', 'checksum': '***'}, 'config': {'enabled': True, 'alias': None, 'schema': 'example', 'database': None, 'tags': [], 'meta': {}, 'materialized': 'seed', 'incremental_strategy': None, 'persist_docs': {}, 'quoting': {}, 'column_types': {}, 'full_refresh': None, 'unique_key': None, 'on_schema_change': 'ignore', 'grants': {}, 'packages': [], 'docs': {'show': True, 'node_color': None}, 'quote_columns': None, 'post-hook': [], 'pre-hook': []}, 'tags': [], 'description': '', 'columns': {'id': {'name': 'id', 'description': '', 'meta': {}, 'data_type': None, 'quote': None, 'tags': []}, 'first_name': {'name': 'first_name', 'description': '', 'meta': {}, 'data_type': None, 'quote': None, 'tags': []}, 'last_name': {'name': 'last_name', 'description': '', 'meta': {}, 'data_type': None, 'quote': None, 'tags': []}, 'state': {'name': 'state', 'description': '', 'meta': {}, 'data_type': None, 'quote': None, 'tags': []}}, 'meta': {}, 'docs': {'show': True, 'node_color': None}, 'patch_path': '***://seeds/schema.yml', 'build_path': None, 'deferred': False, 'unrendered_config': {'schema': 'example'}, 'created_at': 1677196816.612276, 'relation_name': '"web"."example"."customer"', 'raw_code': '', 'root_path': '***', 'depends_on': {'macros': []}}}

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

…s_on

dbt's manifest file can have seeds that list a depends_on key without the nodes. this change checkes to ensure the nodes key is present before appending to the upstream_nodes list
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Mar 1, 2023
@shirshanka shirshanka added the accepted An Issue that is confirmed as a bug by the DataHub Maintainers. label Mar 2, 2023
Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@hsheth2 hsheth2 changed the title fix(manifest-parser): checks to ensure nodes key is present fix(ingest/dbt): check for nodes key before accessing Mar 2, 2023
Kevin G and others added 2 commits March 2, 2023 08:40
Change single quotes to double

Co-authored-by: Harshal Sheth <hsheth2@gmail.com>
@hsheth2 hsheth2 merged commit 6226889 into datahub-project:master Mar 2, 2023
@khgouldy khgouldy deleted the fix/dbt-core-manifest branch March 13, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted An Issue that is confirmed as a bug by the DataHub Maintainers. 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

3 participants