You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When following the documentation here and running the command sqlmesh init -t dbt, keeps getting error like below:
Traceback (most recent call last):
File "/home/venvs/sqlmesh_env/bin/sqlmesh", line 8, in <module>
sys.exit(cli())
^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/cli/__init__.py", line 29, in wrapper
return handler(sqlmesh_context, lambda: func(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/cli/__init__.py", line 38, in _default_exception_handler
return func()
^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/cli/__init__.py", line 29, in <lambda>
return handler(sqlmesh_context, lambda: func(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/core/analytics/__init__.py", line 82, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/cli/main.py", line 159, in init
init_example_project(
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/cli/example_project.py", line 287, in init_example_project
_create_config(config_path, dialect, settings, start, template)
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/cli/example_project.py", line 323, in _create_config
project_config = _gen_config(dialect, settings, start, template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venvs/sqlmesh_env/lib/python3.11/site-packages/sqlmesh/cli/example_project.py", line 72, in _gen_config
f" # {doc_link.format(engine_link=engine_link)}\n{connection_settings}"
^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'connection_settings' where it is not associated with a value
(sqlmesh_env) FAIL: 1
After looking at the example_project.py, looks like it needs an engine name to be passed to a variable dialect - i.e. sqlmesh init -t dbt athena/snowflake/mysql - As long as the engine is in CONNECTION_CONFIG_TO_TYPE.
Therefore, by updating the documentation with the engine type, this command works as expected.
No, the need to specify the dialect is simply mentioned in the init cli usage docs, but not in the dbt docs. Thanks for your contribution @JunqiYangjqy only if you could please rename engine-name to dialect to keep it consistent with the rest of the documentation.
No, the need to specify the dialect is simply mentioned in the init cli usage docs, but not in the dbt docs. Thanks for your contribution @JunqiYangjqy only if you could please rename engine-name to dialect to keep it consistent with the rest of the documentation.
Thanks all :)
Will update the name tomorrow morning.
Cheers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
sqlmesh version: 0.170.1
engine: snowflake
When following the documentation here and running the command
sqlmesh init -t dbt, keeps getting error like below:After looking at the
example_project.py, looks like it needs an engine name to be passed to a variabledialect- i.e.sqlmesh init -t dbt athena/snowflake/mysql- As long as the engine is inCONNECTION_CONFIG_TO_TYPE.Therefore, by updating the documentation with the engine type, this command works as expected.