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

BigQuery Materalized view getting 'NoneType' object is not iterable #37

Closed
Tracked by #47
dannnnthemannnn opened this issue Dec 2, 2022 · 7 comments
Closed
Tracked by #47

Comments

@dannnnthemannnn
Copy link

Here is the error I am getting by adding the default and bigquery folders to my macros folder:

07:08:25  Encountered an error:
'NoneType' object is not iterable
07:08:25  Traceback (most recent call last):
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/main.py", line 135, in main
    results, succeeded = handle_and_check(args)
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/main.py", line 198, in handle_and_check
    task, res = run_from_args(parsed)
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/main.py", line 245, in run_from_args
    results = task.run()
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/task/runnable.py", line 453, in run
    self._runtime_initialize()
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/task/runnable.py", line 161, in _runtime_initialize
    super()._runtime_initialize()
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/task/runnable.py", line 94, in _runtime_initialize
    self.load_manifest()
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/task/runnable.py", line 81, in load_manifest
    self.manifest = ManifestLoader.get_full_manifest(self.config)
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/parser/manifest.py", line 221, in get_full_manifest
    manifest = loader.load()
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/parser/manifest.py", line 320, in load
    self.load_and_parse_macros(project_parser_files)
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/parser/manifest.py", line 438, in load_and_parse_macros
    self.macro_depends_on()
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/parser/manifest.py", line 532, in macro_depends_on
    possible_macro_calls = statically_extract_macro_calls(
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/clients/jinja_static.py", line 43, in statically_extract_macro_calls
    ad_macro_calls = statically_parse_adapter_dispatch(
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/clients/jinja_static.py", line 147, in statically_parse_adapter_dispatch
    macro = db_wrapper.dispatch(func_name, macro_namespace=macro_namespace).macro
  File "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/context/providers.py", line 166, in dispatch
    for package_name in search_packages:
TypeError: 'NoneType' object is not iterable
@minhajpasha
Copy link

+1

1 similar comment
@dongchris
Copy link

+1

@WesleyBatista
Copy link

I am getting the same traceback when copying macros from dbt-labs/dbt-external-tables as dbt-external-tables folder into my project's macros.

This is the folder structure I have:

macros
├── add_rows_limit.sql
├── dbt-external-tables
│   ├── common
│   └── plugins
└── generate_schema_name.sql

Am I missing anything?

@philipp-heinrich
Copy link

Did anyone make this work?

Seems like a connected issue too: dbt-labs/dbt-core#4596

@daniel-bartley
Copy link

+1

@irfanmobin
Copy link

in my experience, this issue is usually when you have a jinja variable in one of your models, but it does not have a default value, so when DBT tries to build the manifest, it fails.

i have no idea why it has this behaviour, but it is what it is i guess. make sure you have default values

@dataders
Copy link

dataders commented Jun 4, 2024

This bug should no longer exist in the official implementation!

Materialized Views have been supported in dbt since dbt-core 1.7 (November 2023). See dbt docs: materialized views and dbt docs: Big Query configurations: materialized views for more information.

The version of materialized views in this experimental repo is is long-overdue for official deprecation -- it has not been meaningfully maintained or improved for over three years (see #11).

If you haven't already, you should try out the official implementation! Should you encounter an issue, you can then open bug or enhancement ticket on either dbt-core or the dbt-bigquery for your current data platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants