Skip to content

Commit 21df382

Browse files
add model name in the error message
1 parent 6302571 commit 21df382

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sqlmesh/core/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ def plan_builder(
16211621
or to_timestamp(snapshot.node.start) > end_ts
16221622
):
16231623
raise SQLMeshError(
1624-
f"Start date / time ({to_datetime(start_ts)}) can't be greater than end date / time ({to_datetime(end_ts)}).\n"
1624+
f"Model '{model_name}': Start date / time ({to_datetime(start_ts)}) can't be greater than end date / time ({to_datetime(end_ts)}).\n"
16251625
f"Set the `start` attribute in your project config model defaults to avoid this issue."
16261626
)
16271627

tests/core/test_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,6 +3060,6 @@ def test_plan_no_start_configured():
30603060
# This should raise an error because the model has no start configured and the end time is less than the start time which will be calculated from the intervals
30613061
with pytest.raises(
30623062
SQLMeshError,
3063-
match=r"Set the `start` attribute in your project config model defaults to avoid this issue",
3063+
match=r"Model '.*xvg.*': Start date / time .* can't be greater than end date / time .*\.\nSet the `start` attribute in your project config model defaults to avoid this issue",
30643064
):
30653065
context.plan("dev", execution_time="1999-01-05")

0 commit comments

Comments
 (0)