Repository navigation
v1.12.3
Behavior changes
date_truncwithhour,minute,secondormillisecondreturns adatetime2truncated to that unit, as other adapters do. It returned midnight as adate, or failed with an overflow. Run a full refresh of incremental models that store these values, to fix old rows and change the column fromdate.⚠️ Important Behavior Changes since 1.11, check 1.12 release notes
Bugfixes
SQLServerConnectionManager.cancel()falls back to the ADBC cursor'sadbc_cancel()when the cursor exposes nocancel(), so interrupting a run withbackend: adbcnow issues the cancel instead of skipping it. The ADBCmssqldriver 1.8.0 accepts the call without stopping the statement; pyodbc keeps thecursor.cancel()path, mssql-python goes through the statement handle, and cancellation stays best-effort. (#922)- Escape the database name in the
pyodbcandmssql-pythonconnection strings, so a name containing;,{or}can no longer add or change connection settings. - Fix
deniessplitting a principal given as a string, such asdenies={"select": "reporting"}, into one principal per letter, so the DENY never applied. A string is now one principal, as ingrants. - Fix contract columns declared as
moneyorsmallmoneybeing built asdecimal(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 publicCursor.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 publiccancel()takes over as soon as the driver ships one.date_truncwithweekreturned 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_keyfordbt_utils.generate_surrogate_key. It casts inputs tovarchar(8000)instead ofdbt.type_string()(varchar(max)), so the key expression no longer forces surrounding joins and aggregates into row mode. Hashes are unchanged, sincesqlserver__hashalready hashes only the first 8,000 bytes. Opt in by addingdbtto thedbt_utilsdispatch search order. (#912) - Fix log lines that printed
%sand%rplaceholders 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
- @MiConnell made their first contribution in #915
Full Changelog: v1.12.2...v1.12.3