Skip to content

Conversation

chalmerlowe
Copy link
Collaborator

This commit refactors the load_table_from_uri, load_table_from_file, load_table_from_dataframe, and load_table_from_json methods in the BigQuery client.

A new private helper method, _prepare_load_job, has been introduced to centralize the creation and configuration of LoadJob objects. This eliminates redundant code for setting up job IDs, projects, and locations.

A second helper, _prepare_load_config, was also added to standardize the handling of LoadJobConfig objects, merging user-provided configurations with client defaults.

These changes make the loading methods more concise, easier to read, and simpler to maintain.

This commit refactors the `load_table_from_uri`, `load_table_from_file`,
`load_table_from_dataframe`, and `load_table_from_json` methods in the
BigQuery client.

A new private helper method, `_prepare_load_job`, has been introduced to
centralize the creation and configuration of `LoadJob` objects. This
eliminates redundant code for setting up job IDs, projects, and locations.

A second helper, `_prepare_load_config`, was also added to standardize
the handling of `LoadJobConfig` objects, merging user-provided
configurations with client defaults.

These changes make the loading methods more concise, easier to read, and
simpler to maintain.
@chalmerlowe chalmerlowe requested review from a team as code owners August 23, 2025 22:30
@chalmerlowe chalmerlowe requested a review from logachev August 23, 2025 22:30
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Aug 23, 2025
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Aug 23, 2025
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.

2 participants