python_modules/libraries/dagster-gcp/dagster_gcp/configs.py
def _define_shared_fields():
    '''The following fields are shared between both QueryJobConfig and LoadJobConfig.
    '''

    clustering_fields = Field(
        List(String),
        description='''Fields defining clustering for the table

        (Defaults to None).

        Clustering fields are immutable after table creation.
        ''',
        is_optional=True,
    )

    create_disposition = Field(
        BQCreateDisposition,
        description='''Specifies behavior for creating tables.
        See https://g.co/cloud/bigquery/docs/reference/rest/v2/jobs#configuration.query.createDisposition
        ''',
        is_optional=True,
    )

    destination_encryption_configuration = Field(
        String,
        description='''Custom encryption configuration for the destination table.
        Custom encryption configuration (e.g., Cloud KMS keys) or None if using default encryption.
        See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.destinationEncryptionConfiguration
        ''',
        is_optional=True,
    )

    schema_update_options = Field(
        List(BQSchemaUpdateOption),
        description='''Specifies updates to the destination table schema to allow as a side effect
        of the query job.''',
        is_optional=True,
    )

    time_partitioning = Field(
        Dict(
            fields={
                'expiration_ms': Field(
                    Int,
                    description='''Number of milliseconds for which to keep the storage for a
                    partition.''',
                    is_optional=True,
                ),
                'field': Field(
                    String,
                    description='''If set, the table is partitioned by this field. If not set, the
                    table is partitioned by pseudo column _PARTITIONTIME. The field must be a
                    top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED.''',
                    is_optional=True,
                ),
                'require_partition_filter': Field(
                    Bool,
                    description='''If set to true, queries over the partitioned table require a
                    partition filter that can be used for partition elimination to be specified.''',
                    is_optional=True,
                ),
            }
        ),
        description='Specifies time-based partitioning for the destination table.',
        is_optional=True,
    )

    write_disposition = Field(
        BQWriteDisposition,
        description='''
        Action that occurs if the destination table already exists.
        See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.writeDisposition
        ''',
        is_optional=True,
    )
    return {
        'clustering_fields': clustering_fields,
        'create_disposition': create_disposition,
        'destination_encryption_configuration': destination_encryption_configuration,
        'schema_update_options': schema_update_options,
        'time_partitioning': time_partitioning,
        'write_disposition': write_disposition,
    }
def _define_shared_fields():
    '''The following fields are shared between both QueryJobConfig and LoadJobConfig.
    '''

    clustering_fields = Field(
        List(String),
        description='''Fields defining clustering for the table

        (Defaults to None).

        Clustering fields are immutable after table creation.
        ''',
        is_optional=True,
    )

    create_disposition = Field(
        BQCreateDisposition,
        description='''Specifies behavior for creating tables.
        See https://g.co/cloud/bigquery/docs/reference/rest/v2/jobs#configuration.query.createDisposition
        ''',
        is_optional=True,
    )

    destination_encryption_configuration = Field(
        String,
        description='''Custom encryption configuration for the destination table.
        Custom encryption configuration (e.g., Cloud KMS keys) or None if using default encryption.
        See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.destinationEncryptionConfiguration
        ''',
        is_optional=True,
    )

    schema_update_options = Field(
        List(BQSchemaUpdateOption),
        description='''Specifies updates to the destination table schema to allow as a side effect
        of the query job.''',
        is_optional=True,
    )

    time_partitioning = Field(
        Dict(
            fields={
                'expiration_ms': Field(
                    Int,
                    description='''Number of milliseconds for which to keep the storage for a
                    partition.''',
                    is_optional=True,
                ),
                'field': Field(
                    String,
                    description='''If set, the table is partitioned by this field. If not set, the
                    table is partitioned by pseudo column _PARTITIONTIME. The field must be a
                    top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED.''',
                    is_optional=True,
                ),
                'require_partition_filter': Field(
                    Bool,
                    description='''If set to true, queries over the partitioned table require a
                    partition filter that can be used for partition elimination to be specified.''',
                    is_optional=True,
                ),
            }
        ),
        description='Specifies time-based partitioning for the destination table.',
        is_optional=True,
    )

    write_disposition = Field(
        BQWriteDisposition,
        description='''
        Action that occurs if the destination table already exists.
        See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.writeDisposition
        ''',
        is_optional=True,
    )
    return {
        'clustering_fields': clustering_fields,
        'create_disposition': create_disposition,
        'destination_encryption_configuration': destination_encryption_configuration,
        'schema_update_options': schema_update_options,
        'time_partitioning': time_partitioning,
        'write_disposition': write_disposition,
    }
The following fields are shared between both QueryJobConfig and LoadJobConfig.