You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sqlmesh plan --restate-model requires model files to be present #3260
Since v0.119.0 sqlmesh run does not require any model definitions in the models/ to refresh model data.
While clearing some confusion I had about sqlmesh plan --restate-model's behavior, it was pointed out to me that it should only refresh data, but not update models' definitions (like a regular plan would).
So I expected that a restatement should also not require the definitions, if it only refreshes data. But when testing the behavior it does not seem to be the case.
I believe a restatement shouldn't require model definitions in order to only refresh data, similar to run.
$ ./t.sh && sqlmesh plan -r sqlmesh_example.full_model -s '' -e '' --auto-applyError: `('/tmp/sqlmesh-tmp',)` doesn't seem to have any models... cd into the proper directory or specify the path(s) with -p.
Defining a dummy full_model makes it work:
$ mkdir models &&echo'MODEL (name sqlmesh_example.full_model); select 1 as foo'> models/full_model.sql
$ sqlmesh plan -r sqlmesh_example.full_model -s '' -e '' --auto-applyNo differences when compared to `prod`Models needing backfill (missing dates):└── sqlmesh_example.full_model: 2024-10-15 - 2024-10-15[...]The target environment has been updated successfully
And the original model definition is not replaced by the dummy that was introduced, as expected:
For completeness sake, to demonstrate that sqlmesh run behaves like this since v0.119:
$ uv pip install -U sqlmesh==0.118.0 && ./t.sh && sqlmesh run[...]Error: `('/tmp/sqlmesh-tmp',)` doesn't seem to have any models... cd into the proper directory or specify the path(s) with -p.
$ uv pip install -U sqlmesh==0.119.0 && ./t.sh && sqlmesh run[...]Run finished for environment 'prod'
@hardeybisey, are you still working on this? If not, I'd like to pick it up.
I reproduced it on 0.236.4 (macOS, Python 3.9.6): with the model files removed, sqlmesh plan -r sqlmesh_example.full_model -s '' -e '' --auto-apply still fails with "doesn't seem to have any models", and adding a dummy model still makes the restatement succeed.
I see @mokashang opened #6219 for this just before my comment, so I'll step back from this one. In case it helps review, I also reproduced the bug on the 0.236.4 release on macOS with the same "doesn't seem to have any models" error.
Activity
georgesittas commentedon Oct 18, 2024
This does look like a bug, @izeigerman can you verify?
izeigerman commentedon Oct 24, 2024
Yes, restatements shouldn't require model files now that we purposefully ignore local changes when doing the restatement.
hardeybisey commentedon Nov 9, 2024
@izeigerman can you assign this to me. Thanks.
yadrielsamir commentedon Nov 14, 2026
@hardeybisey, are you still working on this? If not, I'd like to pick it up.
I reproduced it on 0.236.4 (macOS, Python 3.9.6): with the model files removed,
sqlmesh plan -r sqlmesh_example.full_model -s '' -e '' --auto-applystill fails with "doesn't seem to have any models", and adding a dummy model still makes the restatement succeed.yadrielsamir commentedon Nov 14, 2026
I see @mokashang opened #6219 for this just before my comment, so I'll step back from this one. In case it helps review, I also reproduced the bug on the 0.236.4 release on macOS with the same "doesn't seem to have any models" error.