Skip to content

v0.171.0

Choose a tag to compare

@chio-labs-delivery chio-labs-delivery released this 23 Oct 07:27
bf8120b

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

  • add typed SQL macros and require @py./@sql. macro calls (#1224) (21a802b)

Upgrading to typed SQL macros (breaking)

Python macros now live in a python/ folder and every macro call names its kind.

  1. Move each Python macro file, including _-prefixed helper modules the macros import, into a python/ 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 plus python/<file>.py
      Files left directly under a macro folder fail with D013.
  2. 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 as from ._rounding import … keep working unchanged.
  3. Rewrite every macro call from @name(...) to @py.name(...) in models, tests, hooks, audits and seeds' SQL. Bare calls fail with P014. @@var variables and @sql.-prefixed calls are unaffected.
  4. Run sqb compile and fix anything it reports; sqb format --check should 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.