SQLMesh project vars are not recognised in cli (plan) command
I have a model like this with a project varibale @schema_name, when I run sqlmesh plan lafir --select-model "@schema_name.test_model"
import pandas as pd
from sqlmesh import model
@model(
"@schema_name.test_model",
kind="FULL",
columns={"id": "INT"},
)
def execute(*args, **kwargs):
return pd.DataFrame([{"id": 1}])
the output is
No changes to plan: project files match the
lafirenvironment
but when I directly put the value of schema_name like this sqlmesh plan lafir --select-model "test_schema.test_model", it works and I'm getting the desired output
Differences from the
lafirenvironment:Requirements:
- pandas==2.2.3 Models: └── Added: └── test_schema.test_model__lafir Models needing backfill (missing dates): └── test_schema.test_model__lafir: 2020-03-09 - 2025-01-26
Hey @lafirm, this behavior is expected today: variables aren't supported within these CLI flags. Instead, you can use basic regex and some other rules that are described in this page.
Closing this for now, but happy to continue discussing and/or reopen if needed.
Hey @lafirm, this behavior is expected today: variables aren't supported within these CLI flags. Instead, you can use basic regex and some other rules that are described in this page.
Closing this for now, but happy to continue discussing and/or reopen if needed.
alright! thanks @georgesittas for the update. But isn't it appropriate to output that the variables are not supported when we use that in the CLI flags, instead of giving a false output that there are no changes?