Skip to content

Commit 94ce8b8

Browse files
add model name in the error message
1 parent 79fbeda commit 94ce8b8

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
@@ -3055,6 +3055,6 @@ def test_plan_no_start_configured():
30553055
# 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
30563056
with pytest.raises(
30573057
SQLMeshError,
3058-
match=r"Set the `start` attribute in your project config model defaults to avoid this issue",
3058+
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",
30593059
):
30603060
context.plan("dev", execution_time="1999-01-05")

0 commit comments

Comments
 (0)