Skip to content

v1.12.3

Latest

Choose a tag to compare

@axellpadilla axellpadilla released this 24 Nov 02:17
1b45b33

v1.12.3

Behavior changes

  • date_trunc with hour, minute, second or millisecond returns a datetime2 truncated to that unit, as other adapters do. It returned midnight as a date, or failed with an overflow. Run a full refresh of incremental models that store these values, to fix old rows and change the column from date.
  • ⚠️ Important Behavior Changes since 1.11, check 1.12 release notes

Bugfixes

  • SQLServerConnectionManager.cancel() falls back to the ADBC cursor's adbc_cancel() when the cursor exposes no cancel(), so interrupting a run with backend: adbc now issues the cancel instead of skipping it. The ADBC mssql driver 1.8.0 accepts the call without stopping the statement; pyodbc keeps the cursor.cancel() path, mssql-python goes through the statement handle, and cancellation stays best-effort. (#922)
  • Escape the database name in the pyodbc and mssql-python connection strings, so a name containing ;, { or } can no longer add or change connection settings.
  • Fix denies splitting a principal given as a string, such as denies={"select": "reporting"}, into one principal per letter, so the DENY never applied. A string is now one principal, as in grants.
  • Fix contract columns declared as money or smallmoney being built as decimal(18,0), which rounded every value to a whole number. They now keep the declared type. An incremental model built with the old type keeps it until a full refresh.
  • Fix runs failing when a schema dbt builds into holds a table or view with a 128-character name.
  • SQLServerConnectionManager.cancel() now stops in-flight statements on the mssql-python backend. mssql-python has no public Cursor.cancel() (microsoft/mssql-python#424), so the adapter feature-detects the statement handle's SQLCancel binding, which is the cross-thread cancel the driver itself uses. A public cancel() takes over as soon as the driver ships one.
  • date_trunc with week returned the following Monday for a Sunday. It now returns the Monday on or before the date. Incremental models that store weekly values need a full refresh to correct their Sunday rows.

Under the hood

  • Add sqlserver__generate_surrogate_key for dbt_utils.generate_surrogate_key. It casts inputs to varchar(8000) instead of dbt.type_string() (varchar(max)), so the key expression no longer forces surrounding joins and aggregates into row mode. Hashes are unchanged, since sqlserver__hash already hashes only the first 8,000 bytes. Opt in by adding dbt to the dbt_utils dispatch search order. (#912)
  • Fix log lines that printed %s and %r placeholders instead of their values.
  • Fix query timings in the log being rounded to whole seconds.

What's Changed

  • fix: log values, query timings, 128-character names, database escaping by @joshmarkovic in #911
  • fix(denies): treat a string principal as one principal by @joshmarkovic in #910
  • fix(contracts): keep money and smallmoney column types by @joshmarkovic in #909
  • fix(date_trunc): correct weeks, hours, minutes and seconds by @joshmarkovic in #908
  • build(deps): bump the uv-security group across 1 directory with 5 updates by @dependabot[bot] in #913
  • build(deps): bump the github-actions-updates group across 1 directory with 2 updates by @dependabot[bot] in #907
  • [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in #906
  • perf(dbt_utils): add sqlserver__generate_surrogate_key with bounded casts by @MiConnell in #915
  • fix(cancel): stop in-flight statements on adbc and mssql-python by @axellpadilla in #923
  • chore(release): prepare 1.12.3 by @axellpadilla in #924

New Contributors

Full Changelog: v1.12.2...v1.12.3