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

[CT-2424] [Regression] Duplicate Seed or Snapshot across packages fails with: AttributeError: object has no attribute 'version' #7375

Closed
MichelleArk opened this issue Apr 17, 2023 · 0 comments · Fixed by #7376

Comments

@MichelleArk
Copy link
Contributor

Creating a duplicate seed or snapshot across multiple packages currently crashes with:

22:06:04  Traceback (most recent call last):
  File "/Users/michelleark/src/dbt-core/core/dbt/cli/requires.py", line 86, in wrapper
    result, success = func(*args, **kwargs)
  File "/Users/michelleark/src/dbt-core/core/dbt/cli/requires.py", line 71, in wrapper
    return func(*args, **kwargs)
  File "/Users/michelleark/src/dbt-core/core/dbt/cli/requires.py", line 142, in wrapper
    return func(*args, **kwargs)
  File "/Users/michelleark/src/dbt-core/core/dbt/cli/requires.py", line 168, in wrapper
    return func(*args, **kwargs)
  File "/Users/michelleark/src/dbt-core/core/dbt/cli/requires.py", line 215, in wrapper
    return func(*args, **kwargs)
  File "/Users/michelleark/src/dbt-core/core/dbt/cli/requires.py", line 242, in wrapper
    manifest = ManifestLoader.get_full_manifest(
  File "/Users/michelleark/src/dbt-core/core/dbt/parser/manifest.py", line 229, in get_full_manifest
    _check_manifest(manifest, config)
  File "/Users/michelleark/src/dbt-core/core/dbt/parser/manifest.py", line 1131, in _check_manifest
    _check_resource_uniqueness(manifest, config)
  File "/Users/michelleark/src/dbt-core/core/dbt/parser/manifest.py", line 1109, in _check_resource_uniqueness
    if existing_node is not None and existing_node.version is None:
AttributeError: 'SeedNode' object has no attribute 'version'

The expected behaviour should instead be:

Compilation Error
  dbt found two seeds with the name "raw_customers".
  
  Since these resources have the same name, dbt will be unable to find the correct resource
  when looking for ref("raw_customers").
  
  To fix this, change the name of one of these resources:
  - seed.project_b.raw_customers (seeds/raw_customers.csv)
  - seed.project_a.raw_customers (seeds/raw_customers.csv)

This is because an unsafe access to the version attribute is attempted in _check_resource_uniqueness: https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/parser/manifest.py#L1109

@MichelleArk MichelleArk self-assigned this Apr 17, 2023
@github-actions github-actions bot changed the title [Regression] Duplicate Seed or Snapshot across packages fails with: AttributeError: object has no attribute 'version' [CT-2424] [Regression] Duplicate Seed or Snapshot across packages fails with: AttributeError: object has no attribute 'version' Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant