z3z1ma / dbt-osmosis

Provides automated YAML management, a dbt server, streamlit workbench, and git-integrated dbt model output diff tools
https://z3z1ma.github.io/dbt-osmosis/
Apache License 2.0
422 stars 45 forks source link

AttributeError: 'NoneType' object has no attribute 'resolve' on yaml commands #50

Closed sicarul closed 1 year ago

sicarul commented 1 year ago

Hey there!

I'm trying to make this work and it fails right away, i'm not sure if i'm doing something wrong. Currently no yaml files with schemas exist in the project. The three yaml commands throw this same error.

Error:

dbt-osmosis yaml refactor
INFO     🌊 Executing dbt-osmosis                                                                                                                                                                                                                                  main.py:132

12:13:01  Unable to do partial parsing because config vars, config profile, or config target have changed
INFO     📈 Searching project stucture for required updates and building action plan                                                                                                                                                                            osmosis.py:480
INFO     ...building project structure mapping in memory                                                                                                                                                                                                        osmosis.py:377
Traceback (most recent call last):
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/bin/dbt-osmosis", line 8, in <module>
    sys.exit(cli())
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/dbt_osmosis/main.py", line 81, in wrapper
    return func(*args, **kwargs)
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/dbt_osmosis/main.py", line 143, in refactor
    if runner.commit_project_restructure_to_disk():
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/dbt_osmosis/core/osmosis.py", line 510, in commit_project_restructure_to_disk
    blueprint = self.draft_project_structure_update_plan()
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/dbt_osmosis/core/osmosis.py", line 486, in draft_project_structure_update_plan
    for unique_id, schema_file in self.build_schema_folder_mapping().items():
  File "/Users/pabloseibelt/dev/dwh-workflows/transform/dbt/src/venv/lib/python3.10/site-packages/dbt_osmosis/core/osmosis.py", line 385, in build_schema_folder_mapping
    current=schema_path.resolve(),
AttributeError: 'NoneType' object has no attribute 'resolve'

Config:

models:
  mydwh:
    +dbt-osmosis: "schema/{model}.yml"

dbt:

dbt --version
Core:
  - installed: 1.4.5
  - latest:    1.4.5 - Up to date!

Plugins:
  - snowflake: 1.4.2 - Up to date!

dbt-osmosis:

dbt-osmosis --version
dbt-osmosis, version 0.11.8

OS: Mac OS X Ventura 13.2.1

Thanks!!

yingyingqiqi commented 1 year ago

I have the same problem, is there a solution?

z3z1ma commented 1 year ago

Taking a look now 👀

z3z1ma commented 1 year ago

@sicarul @yingyingqiqi

Can you give the latest version a go. dbt-osmosis==0.11.9 I shipped a hot-fix.

sicarul commented 1 year ago

You are the man. It worked now!