Skip to content

Add BigQuery UDF support - #2007

Closed
takbab wants to merge 4 commits into
googleapis:masterfrom
takbab:feature-bigquery-udf-support
Closed

Add BigQuery UDF support#2007
takbab wants to merge 4 commits into
googleapis:masterfrom
takbab:feature-bigquery-udf-support

Conversation

@takbab

@takbabtakbab commented Jul 21, 2016

Copy link
Copy Markdown

Add a field to support BigQuery UDF.
https://cloud.google.com/bigquery/docs/reference/v2/jobs

  • configuration.query.userDefinedFunctionResources[]
  • configuration.query.userDefinedFunctionResources[].inlineCode
  • configuration.query.userDefinedFunctionResources[].resourceUri

(migrated from #1988)

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 21, 2016
Comment threadgcloud/bigquery/job.py Outdated
reference/v2/jobs#configuration.query.useLegacySql
"""

udf_resources = _TypedProperty(

This comment was marked as spam.

This comment was marked as spam.

@tseaver

Copy link
Copy Markdown
Contributor

@takbab I think @dhermes was talking about dropping the use of _TypedProperty in favor of a property implementation which enforces that items in the list are suitable. If we use your class for the items in the list, then the property implementation would look something like:

@propertydefudf_resources(self):
"""List of user-defined resources. :rtype: list of :class:`UdfResource` :returns: the list, if set, or None """returnlist(self._udf_resources) ifself._udf_resourceselseNone@udf_resources.setterdefudf_resources(self, value):
"""Update list of user-defined resources :type value: list of :class:`UdfResource` :param value: the new list :raises: ValueError, ir the items in the list are not all instances of :class:`UdfResource` """ifnotall((isinstance(item, UdfResource) foriteminvalue)):
raiseValueError("pass a list of UdfResource instances")
self._udf_resources=tuple(value)

@tseaver

Copy link
Copy Markdown
Contributor

See #2015 for an alternative.

@dwmclary

Copy link
Copy Markdown
Contributor

#2015 looks a more like the example from @tseaver but I need to clean up a lint error. What's the advantage to the approach here?

@takbab

Copy link
Copy Markdown
Author

@tseaver Thanks for the example! I have added the property to QueryJob class.

What can we do?
I just want to use UDF from my app.
#1829

@tseaver

Copy link
Copy Markdown
Contributor

@takbab Thanks again for the patch! I merged @dwmclary's version of the feature in #2029, as it looked closer to what I had in mind.

@tseavertseaver closed this Jul 27, 2016
@takbab

Copy link
Copy Markdown
Author

I see, thanks!

@tseavertseaver mentioned this pull request Aug 3, 2016
parthea pushed a commit that referenced this pull request Nov 24, 2025
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Mar 6, 2026
* adds pending deprecation warning
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* revise code to put version function in version helpers
* Update noxfile.py
* Update google/cloud/bigquery/__init__.py
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Lingqing Gan <lingqing.gan@gmail.com>
parthea pushed a commit that referenced this pull request Apr 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@takbab@tseaver@dwmclary@dhermes@googlebot