Skip to content

Commit 89e3ee1

Browse files
committed
Fix the way arguments are passed from CLI to UI
1 parent 133541d commit 89e3ee1

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

sqlmesh/cli/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,12 @@ def ui(
471471

472472
os.environ["PROJECT_PATH"] = str(ctx.obj.path)
473473
if ctx.parent:
474-
os.environ["CONFIG"] = ctx.parent.params.get("config") or ""
475-
os.environ["GATEWAY"] = ctx.parent.params.get("gateway") or ""
474+
config = ctx.parent.params.get("config")
475+
gateway = ctx.parent.params.get("gateway")
476+
if config:
477+
os.environ["CONFIG"] = config
478+
if gateway:
479+
os.environ["GATEWAY"] = gateway
476480
uvicorn.run(
477481
"web.server.main:app",
478482
host=host,

web/server/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import logging
5+
import typing as t
56
from functools import lru_cache
67
from pathlib import Path
78

@@ -26,7 +27,7 @@
2627
class Settings(BaseSettings):
2728
project_path: Path = Path("examples/sushi")
2829
config: str = ""
29-
gateway: str = ""
30+
gateway: t.Optional[str] = None
3031

3132

3233
@lru_cache()

0 commit comments

Comments
 (0)