google.cloud.bigquery.routine.Routine¶
-
class
google.cloud.bigquery.routine.
Routine
(routine_ref, **kwargs)[source]¶ Resource representing a user-defined routine.
See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
- Parameters
routine_ref (Union[str, google.cloud.bigquery.routine.RoutineReference]) – A pointer to a routine. If
routine_ref
is a string, it must included a project ID, dataset ID, and routine ID, each separated by.
.**kwargs (Dict) – Initial property values.
-
__init__
(routine_ref, **kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(routine_ref, **kwargs)Initialize self.
from_api_repr
(resource)Factory: construct a routine given its API representation.
Construct the API resource representation of this routine.
Attributes
Input/output argument of a function or a stored procedure.
The body of the routine.
Datetime at which the routine was created (
None
until set from the server).ID of dataset containing the routine.
Description of the routine (defaults to
None
).ETag for the resource (
None
until set from the server).The path of the imported JavaScript libraries.
The language of the routine.
Datetime at which the routine was last modified (
None
until set from the server).URL path for the routine’s APIs.
ID of the project containing the routine.
Reference describing the ID of this routine.
Return type of the routine.
The routine ID.
The fine-grained type of the routine.
-
property
arguments
¶ Input/output argument of a function or a stored procedure.
In-place modification is not supported. To set, replace the entire property value with the modified list of
RoutineArgument
objects.
-
property
created
¶ Datetime at which the routine was created (
None
until set from the server).Read-only.
- Type
Optional[datetime.datetime]
-
classmethod
from_api_repr
(resource)[source]¶ Factory: construct a routine given its API representation.
-
property
imported_libraries
¶ The path of the imported JavaScript libraries.
The
language
must equalJAVACRIPT
.Examples
Set the
imported_libraries
to a list of Google Cloud Storage URIs.routine = bigquery.Routine("proj.dataset.routine_id") routine.imported_libraries = [ "gs://cloud-samples-data/bigquery/udfs/max-value.js", ]
- Type
List[str]
-
property
modified
¶ Datetime at which the routine was last modified (
None
until set from the server).Read-only.
- Type
Optional[datetime.datetime]
-
property
reference
¶ Reference describing the ID of this routine.
-
property
return_type
¶ Return type of the routine.
If absent, the return type is inferred from
body
at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time.See: https://cloud.google.com/bigquery/docs/reference/rest/v2/routines#Routine.FIELDS.return_type
- Type
google.cloud.bigquery_v2.types.StandardSqlDataType
-
property
type_
¶ The fine-grained type of the routine.
See: https://cloud.google.com/bigquery/docs/reference/rest/v2/routines#RoutineType
- Type