Skip to content

Conversation

@QMalcolm
Copy link
Contributor

resolves #1345

Problem

dbt-core added the ability to set function node volatility in dbt-labs/dbt-core#12100. Thus in adapters we needed to begin interpolating the correct volatility value into the function materialization macros.

Solution

  • Create new macros for interpolating volatility for a given function node
  • Test that the volatility gets set (and still successfully creates the function)

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

Technically it should be impossible for a new volatility to be created
without our knowledge of it and for it to reach dbt-adapters macros. That
is because `volatility` is defined as an `Enum` in core with only three
possible values `deterministic`, `stable`, and `non-deterministic`. But
if a new volatility is invented, and we start supporting setting it in core
then we will want to handle it in dbt-adapters (by default as a warning) until
we add _specific_ handling in dbt-adapters to support it.
@QMalcolm QMalcolm merged commit f48874f into main Oct 31, 2025
48 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--1345-begin-templating-volatility-for-scalar-functions branch October 31, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes The PR author has signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UDFs] A function's volatility is propagated to the create/replace function logic

3 participants