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

SQLMesh UI fails with multi project setup (at least dbt + sqlmesh project) #3335

Open
Kayrnt opened this issue Nov 5, 2024 · 0 comments
Open
Labels
Improvement Improves existing functionality Project: UI Issues related to creating the UI

Comments

@Kayrnt
Copy link
Contributor

Kayrnt commented Nov 5, 2024

Description

Running a command such as:
sqlmesh -p ./dbt_project -p ./sqlmesh_project ui would fail with following stacktrace

22:26:21  Registered adapter: bigquery=1.8.3
Traceback (most recent call last):
  File "/opt/homebrew/anaconda3/envs/sqlmesh/bin/sqlmesh", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/sqlmesh/cli/__init__.py", line 31, in wrapper
    return handler(sqlmesh_context, lambda: func(*args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/sqlmesh/cli/__init__.py", line 40, in _default_exception_handler
    return func()
           ^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/sqlmesh/cli/__init__.py", line 31, in <lambda>
    return handler(sqlmesh_context, lambda: func(*args, **kwargs))
                                            ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/sqlmesh/core/analytics/__init__.py", line 71, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/sqlmesh/lib/python3.11/site-packages/sqlmesh/cli/main.py", line 712, in ui
    os.environ["PROJECT_PATH"] = ctx.obj
    ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "<frozen os>", line 684, in __setitem__
  File "<frozen os>", line 758, in encode
TypeError: str expected, not Context
make: *** [ui] Error 1

SQLMesh version used: 0.130.2

To reproduce it

You may clone https://github.com/bqbooster/dbt_sqlmesh_multi_project and run the command sqlmesh -p ./dbt_project -p ./sqlmesh_project ui (or use make ui)

@georgesittas georgesittas added Feature Adds new functionality Improvement Improves existing functionality Project: UI Issues related to creating the UI and removed Feature Adds new functionality labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Improves existing functionality Project: UI Issues related to creating the UI
Projects
None yet
Development

No branches or pull requests

2 participants