gfw.common.beam.transforms.ReadFromBigQuery#
- class ReadFromBigQuery(query, output_type=<class 'dict'>, method='EXPORT', use_standard_sql=True, read_from_bigquery_factory=<class 'apache_beam.io.gcp.bigquery.ReadFromBigQuery'>, read_from_bigquery_kwargs=None, **kwargs)[source]#
Wrapper around
ReadFromBigQuerywith optional casting.- Parameters:
query (str) – The query to execute.
output_type (type) – The Beam type hint for the output (e.g., a
NamedTuple). If not provided, defaults to dict.method (str) – The method to use to read from BigQuery. It may be
EXPORTorDIRECT_READ.use_standard_sql (bool) – Specifies whether to use BigQuery’s standard SQL dialect for this query. Defaults to True.
read_from_bigquery_factory (Callable[..., io.ReadFromBigQuery]) – A factory function used to create a
ReadFromBigQueryinstance. This is primarily useful for testing, where you may want to inject a custom or fake implementation instead of using the real transform. If not provided, the default class will be used.write_to_bigquery_kwargs – Any additional keyword arguments to be passed to
ReadFromBigQueryclass. Check official Apache Beam documentation.**kwargs (Any) – Additional keyword arguments passed to base PTransform class.
Methods
annotationsdefault_labeldefault_type_hintsReturns the display data associated to a pipeline component.
Applies PCollection to read from BigQuery.
Creates a ReadFromBigQuery PTransform from a Query object.
from_runner_apiReturns a factory for ReadFromPubSub objects.
get_resource_hintsGets and/or initializes type hints for this object.
Returns the window function to be associated with transform's output.
infer_output_typeregister_urnrunner_api_requires_keyed_inputto_runner_apito_runner_api_parameterto_runner_api_pickledtype_check_inputstype_check_inputs_or_outputstype_check_outputsAnnotates the input type of a
PTransformwith a type-hint.Annotates the output type of a
PTransformwith a type-hint.Adds resource hints to the
PTransform.Attributes
labelpipelineside_inputs- classmethod get_client_factory(mocked=False)[source]#
Returns a factory for ReadFromPubSub objects.
- Return type: