Repository navigation
v0.171.0
0.171.0 (2026-10-23)
⚠ BREAKING CHANGES
- Python macros now live in macros/python/ (and the python/ folder of scoped macro roots) and are called as
@py.name(...). A macro file directly under a macros/ folder fails with D013, and a bare @name(...) call fails with P014; move files into macros/python/ and replace @name( with@py.name( in project SQL.
Features
Upgrading to typed SQL macros (breaking)
Python macros now live in a python/ folder and every macro call names its kind.
- Move each Python macro file, including
_-prefixed helper modules the macros import, into apython/subfolder of its macro folder:macros/<file>.py→macros/python/<file>.py- scoped
<folder>/_sqlbuild/_macros/<file>.py(or_macros/<file>.py) → the same folder pluspython/<file>.py
Files left directly under a macro folder fail with D013.
- Update Python imports of moved macro and helper modules (
from macros.currency import …→from macros.python.currency import …,from macros._rounding import …→from macros.python._rounding import …, and the same for scoped paths). Relative imports such asfrom ._rounding import …keep working unchanged. - Rewrite every macro call from
@name(...)to@py.name(...)in models, tests, hooks, audits and seeds' SQL. Bare calls fail with P014.@@varvariables and@sql.-prefixed calls are unaffected. - Run
sqb compileand fix anything it reports;sqb format --checkshould pass unchanged.
Logic-free Python macros (pure SQL text with parameters) are candidates for the new SQL macros in macros/sql/; see the SQL macros docs.