| :py:mod:`airflow.providers.google.cloud.transfers.postgres_to_gcs` |
| ================================================================== |
| |
| .. py:module:: airflow.providers.google.cloud.transfers.postgres_to_gcs |
| |
| .. autoapi-nested-parse:: |
| |
| PostgreSQL to GCS operator. |
| |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.google.cloud.transfers.postgres_to_gcs.PostgresToGCSOperator |
| |
| |
| |
| |
| .. py:class:: PostgresToGCSOperator(*, postgres_conn_id='postgres_default', use_server_side_cursor=False, cursor_itersize=2000, **kwargs) |
| |
| Bases: :py:obj:`airflow.providers.google.cloud.transfers.sql_to_gcs.BaseSQLToGCSOperator` |
| |
| Copy data from Postgres to Google Cloud Storage in JSON, CSV or Parquet format. |
| |
| :param postgres_conn_id: Reference to a specific Postgres hook. |
| :param use_server_side_cursor: If server-side cursor should be used for querying postgres. |
| For detailed info, check https://www.psycopg.org/docs/usage.html#server-side-cursors |
| :param cursor_itersize: How many records are fetched at a time in case of server-side cursor. |
| |
| .. py:attribute:: ui_color |
| :annotation: = #a0e08c |
| |
| |
| |
| .. py:attribute:: type_map |
| |
| |
| |
| |
| .. py:method:: query() |
| |
| Queries Postgres and returns a cursor to the results. |
| |
| |
| .. py:method:: field_to_bigquery(field) |
| |
| Convert a DBAPI field to BigQuery schema format. |
| |
| |
| .. py:method:: convert_type(value, schema_type, stringify_dict=True) |
| |
| Takes a value from Postgres, and converts it to a value that's safe for |
| JSON/Google Cloud Storage/BigQuery. |
| Timezone aware Datetime are converted to UTC seconds. |
| Unaware Datetime, Date and Time are converted to ISO formatted strings. |
| Decimals are converted to floats. |
| |
| :param value: Postgres column value. |
| :param schema_type: BigQuery data type. |
| :param stringify_dict: Specify whether to convert dict to string. |
| |
| |
| |