Skip to content

[Bug] persist_docs not supported for UDFs #1815

@Tonayya

Description

@Tonayya

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Which packages are affected?

  • dbt-adapters
  • dbt-tests-adapter
  • dbt-athena
  • dbt-athena-community
  • dbt-bigquery
  • dbt-postgres
  • dbt-redshift
  • dbt-snowflake
  • dbt-spark

Current Behavior

When persist_docs is configured on UDFs like below:

dbt_project.yml

functions:
  +persist_docs:
    relation: true
    columns: true

dbt tries to access the tables path instead of routines path in Bigquery and therefore the operation fails with error:

[ERROR]: Unhandled error while executing target/run/tonayya_does_bigquery/functions/is_positive_int.py
404 GET https://bigquery.googleapis.com/bigquery/v2/projects/cse-sandbox-319708/datasets/dbt_tsabzizar_dbt_tsabzizar/tables/is_positive_int?prettyPrint=false: Not found: Table cse-sandbox-319708:dbt_tsabzizar_dbt_tsabzizar.is_positive_int

UDFs are stored under routines:

Image

Expected Behavior

If persist_docs are supposed to be supported for UDFs, then we should be sending the request to the correct path. If this is not a supported property for UDFs, then we should throw a meaningful error.

Steps To Reproduce

  1. Add a dummy UDF to a project with Bigquery connection
  2. add persist_docs on functions in dbt_project.yml file
  3. run command dbt build -s your_function

Relevant log output

Environment

- OS:
- Python:
- dbt-adapters:
- <adapter>:

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    pkg:dbt-bigqueryIssue affects dbt-bigquerytriage:productIn Product's queuetype:bugSomething isn't working as documented

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions