Reproducer project for the inconsistent behavior of sqlmesh imports when using macros, affected model.
Execute sqlmesh plan.
Using docker:
- docker build -t local/sqlmesh_imports_problem .
- docker run -it --entrypoint=/bin/bash local/sqlmesh_imports_problem
sqlmesh plan
Error: Failed to load model definition at '/app/models/full_model.sql'.
cannot import name '_generate_next_value_' from 'enum' (/usr/local/lib/python3.12/enum.py)
Commenting out the usage of EITHER macro1 or macro2 (both macros use the same import)
in the affected model makes the import error disappear.