Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add default value expression to SchemaField #1408

Merged
merged 7 commits into from
Nov 15, 2022

Conversation

aribray
Copy link
Contributor

@aribray aribray commented Nov 14, 2022

Adds default_value_expression to SchemaField.

        default_value_expression: str, Optional
            Used to specify the default value of a field using a SQL expression. It can only be set for
            top level fields (columns).

            You can use a struct or array expression to specify default value for the entire struct or
            array. The valid SQL expressions are:

            - Literals for all data types, including STRUCT and ARRAY.

            - The following functions:

                `CURRENT_TIMESTAMP`
                `CURRENT_TIME`
                `CURRENT_DATE`
                `CURRENT_DATETIME`
                `GENERATE_UUID`
                `RAND`
                `SESSION_USER`
                `ST_GEOPOINT`

            - Struct or array composed with the above allowed functions, for example:

                "[CURRENT_DATE(), DATE '2020-01-01'"]

Googlers see 241007941

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Nov 14, 2022
@aribray aribray marked this pull request as ready for review November 15, 2022 01:25
@aribray aribray requested a review from a team November 15, 2022 01:25
@aribray aribray requested a review from a team as a code owner November 15, 2022 01:25
@aribray aribray merged commit 207aa50 into googleapis:main Nov 15, 2022
@aribray aribray deleted the aribray--default-value-expression branch November 15, 2022 20:57
@aribray aribray changed the title feat: add default value expression feat: add default value expression to SchemaField Nov 15, 2022
FurcyPin added a commit to FurcyPin/bigquery-frame that referenced this pull request Dec 3, 2022
Following this change:
googleapis/python-bigquery#1408
the SchemaField __init__ and __repr__ method have evolved.

This broke some tests.
FurcyPin added a commit to FurcyPin/bigquery-frame that referenced this pull request Dec 24, 2022
Following this change:
googleapis/python-bigquery#1408
the SchemaField __init__ and __repr__ method have evolved.

This broke some tests.
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull request Apr 17, 2023
* feat: Adds default_value_expression to SchemaField
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants