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

feat: support load job option ColumnNameCharacterMap - #1952

Merged
Linchin merged 4 commits into
googleapis:mainfrom
Linchin:ColumnNameCharacterMap
Jun 14, 2024
Merged

feat: support load job option ColumnNameCharacterMap#1952
Linchin merged 4 commits into
googleapis:mainfrom
Linchin:ColumnNameCharacterMap

Conversation

@Linchin

Copy link
Copy Markdown
Contributor

Fixes#1951 🦕

@Linchin
Linchin requested review from a team and obada-abJune 12, 2024 22:34
@product-auto-labelproduct-auto-labelBot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Jun 12, 2024

@chalmerlowechalmerlowe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.
I have one PREFERENCE to make the test code simpler and potentially easier to parse and maintain in the long run.

config.parquet_options = None
self.assertNotIn("parquetOptions", config._properties["load"])

def test_column_name_character_map_missing(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PREFERENCE:

These tests are nearly identical. The only real change is the choice of setting and whether the outcome matches.

This feels like an ideal situation for a parameterized test.

I would recommend we shorten this code by about 27 lines by using a pytest parameterization.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for the suggestion! It would be really nice if we could make the tests more compact. For the purpose of this PR, I just followed the same pattern as the rest of this test file. I think we can consider revamping the test as a whole so the style of the tests can be more consistent. I do wonder though, because we are not calling the exact same methods in each of the tests (sometimes we assign value in initialization, sometimes by calling the method, or directly accessing the _properties dict), is there a nice way to represent these in test parameterization?

@Linchin
Linchin enabled auto-merge (squash) June 14, 2024 17:20
@Linchin
Linchin merged commit 7e522ee into googleapis:mainJun 14, 2024
@release-pleaserelease-pleaseBot mentioned this pull request Jun 17, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.size: mPull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support load job option ColumnNameCharacterMap

2 participants

@Linchin@chalmerlowe