Skip to content

[CT-1984] [Regression] In v1.4, seeds with hooks calling macros raise an AttributeError #6806

@steveh-101

Description

@steveh-101

Is this a regression in a recent version of dbt-core?

  • I believe this is a regression in dbt-core functionality
  • I have searched the existing issues, and I could not find an existing issue for this regression

Current Behavior

After trying to upgrade both dbt-utils, dbt-core and dbt-snowflake to 1.0.0, 1.4.1 and 1.4.0 respectively, my project no-longer compiles.

Downgrading just the dbt parts (core and snowflake) and it compiles.

Expected/Previous Behavior

I expect that after following migration guides etc. that the project will compile.

It compiles as normal if I downgrade dbt to previous version (1.3.2)

Steps To Reproduce

This is not easily reproducible. It did not affect a new project, just a current one. Something in 1.4.1 is different in the fact that downgrading dbt, the project does compile.

Relevant log output

dbt compile  
18:42:38  Running with dbt=1.4.1
18:42:54  Encountered an error:
'SeedNode' object has no attribute 'depends_on'
18:42:54  Traceback (most recent call last):
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/main.py", line 135, in main
    results, succeeded = handle_and_check(args)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/main.py", line 198, in handle_and_check
    task, res = run_from_args(parsed)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/main.py", line 245, in run_from_args
    results = task.run()
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/task/runnable.py", line 454, in run
    self._runtime_initialize()
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/task/runnable.py", line 165, in _runtime_initialize
    super()._runtime_initialize()
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/task/runnable.py", line 94, in _runtime_initialize
    self.load_manifest()
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/task/runnable.py", line 81, in load_manifest
    self.manifest = ManifestLoader.get_full_manifest(self.config)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/parser/manifest.py", line 203, in get_full_manifest
    manifest = loader.load()
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/parser/manifest.py", line 339, in load
    self.parse_project(
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/parser/manifest.py", line 467, in parse_project
    parser.parse_file(block)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/parser/base.py", line 425, in parse_file
    self.parse_node(file_block)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/parser/base.py", line 386, in parse_node
    self.render_update(node, config)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/parser/base.py", line 363, in render_update
    self.update_parsed_node_config(node, config, context=context)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/parser/base.py", line 336, in update_parsed_node_config
    get_rendered(hook.sql, context, parsed_node, capture_macros=True)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/clients/jinja.py", line 590, in get_rendered
    return render_template(template, ctx, node)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/clients/jinja.py", line 545, in render_template
    return template.render(ctx)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/jinja2/sandbox.py", line 393, in call
    return __context.call(__obj, *args, **kwargs)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/clients/jinja.py", line 328, in __call__
    with self.track_call():
  File "/Users/stephen.herron/.pyenv/versions/3.10.7/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/Users/stephen.herron/.local/share/virtualenvs/snowflake_dbt-aabVNRJU/lib/python3.10/site-packages/dbt/clients/jinja.py", line 319, in track_call
    self.node.depends_on.add_macro(unique_id)
AttributeError: 'SeedNode' object has no attribute 'depends_on'

Environment

  • OS: MacOS
  • Python: 3.10.7
  • dbt-core (working version): 1.3.2
  • dbt-core (regression version): 1.4.1

Which database adapter are you using with dbt?

snowflake

Additional Context

This must be something weird with my project. Out of interest I created a new project in the same virtual env and that worked.

I will start trying to copy over things to see what is causing the breakage, starting with seeds as the error mentioned SeedNode

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions