Skip to content

Commit

Permalink
Chore: put connection config link in a separate line
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas committed Jan 31, 2025
1 parent 2cc96c7 commit 62617d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sqlmesh/cli/example_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _gen_config(
connection_settings = """ type: duckdb
database: db.db"""

doc_link = "# Visit https://sqlmesh.readthedocs.io/en/stable/integrations/engines{engine_link} for more information on configuring the connection to your execution engine."
doc_link = "https://sqlmesh.readthedocs.io/en/stable/integrations/engines{engine_link}"
engine_link = ""

engine = "mssql" if dialect == "tsql" else dialect
Expand Down Expand Up @@ -65,7 +65,8 @@ def _gen_config(
engine_link = f"/{engine}/#connection-options"

connection_settings = (
f" {doc_link.format(engine_link=engine_link)}\n{connection_settings}"
" # For more information on configuring the connection to your execution engine, visit:\n"
f" # {doc_link.format(engine_link=engine_link)}\n{connection_settings}"
)
else:
connection_settings = settings
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ def test_init_project_dialects(runner, tmp_path):
for dialect, expected_config in dialect_to_config.items():
init_example_project(tmp_path, dialect=dialect)

config_start = f"gateways:\n dev:\n connection:\n # Visit https://sqlmesh.readthedocs.io/en/stable/integrations/engines/{dialect}/#connection-options for more information on configuring the connection to your execution engine.\n type: {dialect}\n "
config_start = f"gateways:\n dev:\n connection:\n # For more information on configuring the connection to your execution engine, visit:\n # https://sqlmesh.readthedocs.io/en/stable/integrations/engines/{dialect}/#connection-options\n type: {dialect}\n "
config_end = f"\n\n\ndefault_gateway: dev\n\nmodel_defaults:\n dialect: {dialect}\n start: {yesterday_ds()}\n"

with open(tmp_path / "config.yaml") as file:
Expand Down

0 comments on commit 62617d1

Please sign in to comment.