Skip to content

Conversation

@chalmerlowe
Copy link
Collaborator

Adds several new attributes to SchemaField and adds to the existing test suite to account for the new attributes.

  • foreign_type_definition
  • rounding_mode

@chalmerlowe chalmerlowe requested review from a team as code owners November 22, 2024 16:52
@chalmerlowe chalmerlowe requested a review from tswast November 22, 2024 16:52
@conventional-commit-lint-gcf
Copy link

conventional-commit-lint-gcf bot commented Nov 22, 2024

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@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 22, 2024
INTERVAL = "INTERVAL" # NOTE: not available in legacy types
RANGE = "RANGE" # NOTE: not available in legacy types
FOREIGN = "FOREIGN" # NOTE: type acts as a wrapper for data types
# not natively understood by BigQuery unless translated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can this be indented to align with the rest of the commend above it?

Copy link
Collaborator Author

@chalmerlowe chalmerlowe Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting.
When you try to indent the second line, black the Python formatter kicks the starting point back to the left and aligns it under the F in Foreign.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved both lines of comment above the object FOREIGN so that they both align together.

DATETIME = "DATETIME"
INTERVAL = "INTERVAL" # NOTE: not available in legacy types
RANGE = "RANGE" # NOTE: not available in legacy types
FOREIGN = "FOREIGN" # NOTE: type acts as a wrapper for data types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test that could cover using this new enum?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I supplemented the existing test that walks through some of enums with this enum in particular.

"""Definition of the foreign data type.
Only valid for top-level schema fields (not nested fields).
If the type is FOREIGN, this field is required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there any checks for this?

Copy link
Collaborator Author

@chalmerlowe chalmerlowe Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is now. 😺 Starting around line 250.

@chalmerlowe chalmerlowe merged commit 48c8cc6 into pangea-v1alpha Nov 26, 2024
19 of 20 checks passed
@chalmerlowe chalmerlowe deleted the feat-b358215039-add-attrs-to-schemafield branch November 26, 2024 19:01
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.

3 participants