-
Notifications
You must be signed in to change notification settings - Fork 319
feat: Adds source_column_match and associated tests #2227
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: Adds source_column_match and associated tests #2227
Conversation
There was a problem hiding this 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.
# return None | ||
|
||
@source_column_match.setter | ||
def source_column_match(self, value: Optional[SourceColumnMatch]): |
There was a problem hiding this comment.
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?
google/cloud/bigquery/job/load.py
Outdated
return None | ||
|
||
@source_column_match.setter | ||
def source_column_match(self, value: Optional[SourceColumnMatch]): |
There was a problem hiding this comment.
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?
google/cloud/bigquery/job/load.py
Outdated
@@ -983,6 +1017,13 @@ def clustering_fields(self): | |||
""" | |||
return self.configuration.clustering_fields | |||
|
|||
@property | |||
def source_column_match(self): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Co-authored-by: Tim Sweña (Swast) <swast@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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:
LoadJobConfig
,LoadJob
,ExternalConfig
, andCSVOptions
.