Skip to content

feat(PECOBLR-1766): Python UDF Support#1336

Merged
sd-db merged 6 commits into1.12.latestfrom
sd-db/dbt-databricks-python-udf-support
Mar 3, 2026
Merged

feat(PECOBLR-1766): Python UDF Support#1336
sd-db merged 6 commits into1.12.latestfrom
sd-db/dbt-databricks-python-udf-support

Conversation

@sd-db
Copy link
Copy Markdown
Collaborator

@sd-db sd-db commented Feb 26, 2026

Description

Users want to create Python UDFs using dbt's functions feature on Databricks, but the current dbt-databricks adapter restricts UDF creation to SQL only. This PR looks to add support for Python UDFs (of the following form/format + more)

# def + explicit call -- for more complex logic
def compute(value):
    return value * 2
return compute(value)

# Inline return -- parameters are available as local variables
return value * 2

Checklist

  • 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
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

@sd-db sd-db changed the title [PECOBLR-1766] Python UDF Support feat(PECOBLR-1766): Python UDF Support Feb 26, 2026
@github-actions
Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  relation.py
Project Total  

This report was generated by python-coverage-comment-action

Comment thread tests/functional/adapter/functions/test_udfs.py Outdated
Comment thread tests/functional/adapter/functions/test_udfs.py Outdated
Copy link
Copy Markdown
Collaborator

@benc-db benc-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve with minor test style comments

@sd-db sd-db merged commit 0afc378 into 1.12.latest Mar 3, 2026
15 of 16 checks passed
@sd-db sd-db deleted the sd-db/dbt-databricks-python-udf-support branch March 3, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants