Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

feat: Adds source_column_match and associated tests#2227

Merged
gcf-merge-on-green[bot] merged 14 commits intomainfrom
feat-374142081-add-source-column-match
Jul 15, 2025
Merged

feat: Adds source_column_match and associated tests#2227
gcf-merge-on-green[bot] merged 14 commits intomainfrom
feat-374142081-add-source-column-match

Conversation

@chalmerlowe
Copy link
Copy Markdown
Collaborator

This commit introduces new configuration options for BigQuery load jobs and external table definitions, aligning with recent updates to the underlying protos.

New options added:

  • source_column_name_match_option: Controls how source columns are matched to the schema. (Applies to LoadJobConfig, ExternalConfig, LoadJob)

Changes include:

  • Added corresponding properties (getters/setters) to LoadJobConfig, LoadJob, ExternalConfig, and CSVOptions.
  • Updated docstrings and type hints for all new attributes.
  • Updated unit tests to cover the new options, ensuring they are correctly handled during object initialization, serialization to API representation, and deserialization from API responses.

@chalmerlowe chalmerlowe requested a review from a team July 2, 2025 16:22
@chalmerlowe chalmerlowe requested a review from a team as a code owner July 2, 2025 16:22
@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 Jul 2, 2025
@chalmerlowe chalmerlowe assigned Linchin and unassigned yirutang Jul 2, 2025
@chalmerlowe chalmerlowe requested review from Linchin and removed request for agrawal-siddharth July 2, 2025 16:23
@chalmerlowe chalmerlowe self-assigned this Jul 2, 2025
Copy link
Copy Markdown
Collaborator Author

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

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

Altered docstring formatting to try and eliminate a docs error.

@chalmerlowe chalmerlowe added the automerge Merge the pull request once unit tests and other checks pass. label Jul 15, 2025
# return None

@source_column_match.setter
def source_column_match(self, value: Optional[SourceColumnMatch]):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would like us to allow str in the setter as well. Can you update this, please?

return None

@source_column_match.setter
def source_column_match(self, value: Optional[SourceColumnMatch]):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here. Can we allow str, please?

return self.configuration.clustering_fields

@property
def source_column_match(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing return type annotation?

config._properties["load"]["sourceColumnMatch"] = option_enum.value
self.assertEqual(config.source_column_match, option_enum)

def test_source_column_match_setter(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we add another test where we use the setter with a str, too?

Copy link
Copy Markdown
Collaborator Author

@chalmerlowe chalmerlowe Jul 15, 2025

Choose a reason for hiding this comment

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

Done, both here and in test_external_config.py

Copy link
Copy Markdown
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Thanks!

@gcf-merge-on-green gcf-merge-on-green bot merged commit 6d5d236 into main Jul 15, 2025
28 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jul 15, 2025
@gcf-merge-on-green gcf-merge-on-green bot deleted the feat-374142081-add-source-column-match branch July 15, 2025 22:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants