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

NoneType' object has no attribute 'upper' #40

Closed
edbizarro opened this issue Jul 23, 2021 · 4 comments · Fixed by #41
Closed

NoneType' object has no attribute 'upper' #40

edbizarro opened this issue Jul 23, 2021 · 4 comments · Fixed by #41
Labels
bug Something isn't working

Comments

@edbizarro
Copy link

Hi, i'm trying to use this awesome project with my dbt setup (bigquery) but keep getting this AttributeError: 'NoneType' object has no attribute 'upper'.

I'm running on dbt v0.20.0 and Metabase 0.40.1

Traceback (most recent call last):
  File "/home/edbizarro/.pyenv/versions/analytics-venv-3.7.8/bin/dbt-metabase", line 6, in <module>
    dbtmetabase.main(sys.argv[1:])
  File "/home/edbizarro/.pyenv/versions/3.7.8/envs/analytics-venv-3.7.8/lib/python3.7/site-packages/dbtmetabase/__init__.py", line 248, in main
    include_tags=parsed.include_tags,
  File "/home/edbizarro/.pyenv/versions/3.7.8/envs/analytics-venv-3.7.8/lib/python3.7/site-packages/dbtmetabase/__init__.py", line 114, in export
    mbc.export_models(metabase_database, models, reader.catch_aliases)
  File "/home/edbizarro/.pyenv/versions/3.7.8/envs/analytics-venv-3.7.8/lib/python3.7/site-packages/dbtmetabase/metabase.py", line 156, in export_models
    table_lookup, field_lookup = self.build_metadata_lookups(database_id)
  File "/home/edbizarro/.pyenv/versions/3.7.8/envs/analytics-venv-3.7.8/lib/python3.7/site-packages/dbtmetabase/metabase.py", line 377, in build_metadata_lookups
    table_schema = table.get("schema", "public").upper()
AttributeError: 'NoneType' object has no attribute 'upper'

Command I'm using to test

dbt-metabase export \
    --dbt_manifest_path ./analytics/target/manifest.json \
    --dbt_database analytics \
    --metabase_host ...\
    --metabase_user ... \
    --metabase_password "..." \
    --metabase_database "Analytics" \
    --schema public
@z3z1ma
Copy link
Contributor

z3z1ma commented Jul 23, 2021

Hi @edbizarro

Thanks for the post! Hmm looking at that, the only way its possible to get a None object would be if the schema key is actually present in the API response as expected but the value is null.

I am curious as to how many tables you have returning null for schema key in metadata dict. Would be very insightful to know. I think we can account for it regardless though.

@gouline
Copy link
Owner

gouline commented Jul 23, 2021

From memory, BigQuery has no concept of schema, this was raised a while back in #5 and #7. Possibly related?

@gouline gouline added the bug Something isn't working label Jul 23, 2021
@gouline
Copy link
Owner

gouline commented Jul 23, 2021

Fix released as v0.8.0-rc2. Give it another go @edbizarro.

@edbizarro
Copy link
Author

edbizarro commented Jul 23, 2021

Wow that was fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants