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) → None[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).If set to
DATA_MASKING
, the function is validated and made available as a masking function.ID of dataset containing the routine.
Description of the routine (defaults to
None
).(experimental) The determinism level of the JavaScript UDF if defined.
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.
Optional[google.cloud.bigquery.routine.RemoteFunctionOptions]: Configures remote function options for a routine.
The return type of a Table Valued Function (TVF) 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]
- property data_governance_type¶
If set to
DATA_MASKING
, the function is validated and made available as a masking function.- Raises
ValueError – If the value is not
string
orNone
.- Type
Optional[str]
- property determinism_level¶
(experimental) The determinism level of the JavaScript UDF if defined.
- Type
Optional[str]
- classmethod from_api_repr(resource: dict) → google.cloud.bigquery.routine.routine.Routine[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 remote_function_options¶
Optional[google.cloud.bigquery.routine.RemoteFunctionOptions]: Configures remote function options for a routine.
- Raises
ValueError – If the value is not
RemoteFunctionOptions
orNone
.
- property return_table_type: Optional[google.cloud.bigquery.standard_sql.StandardSqlTableType]¶
The return type of a Table Valued Function (TVF) routine.
New in version 2.22.0.
- 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.StandardSqlDataType
- property type_¶
The fine-grained type of the routine.
See: https://cloud.google.com/bigquery/docs/reference/rest/v2/routines#RoutineType
- Type