This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Repository navigation
fix: load table from json - #1248
Closed
abecerrilsalas wants to merge 39 commits into
Closed
abecerrilsalas wants to merge 39 commits into
abecerrilsalas wants to merge 39 commits into
Conversation
…ilsalas/python-bigquery into load_table_from_json_bug
steffnay
reviewed
May 18, 2022
steffnay
reviewed
May 18, 2022
steffnay
reviewed
May 18, 2022
steffnay
reviewed
May 18, 2022
…ilsalas/python-bigquery into load_table_from_json_bug
steffnay
reviewed
Jun 1, 2022
| self.assertEqual(table.num_rows, 2) | ||
|
|
||
| def test_load_table_from_json_bug_check_with_schema(self): | ||
| table_schema = (bigquery.SchemaField("age", "INTEGER", mode="REQUIRED"),) |
Contributor
There was a problem hiding this comment.
This field should be type "STRING"
steffnay
reviewed
Jun 1, 2022
| table = helpers.retry_403(Config.CLIENT.create_table)(Table(table_id)) | ||
| self.to_delete.insert(0, table) | ||
|
|
||
| job_config = bigquery.LoadJobConfig(schema=table_schema) |
Contributor
There was a problem hiding this comment.
Do we need to provide schema here?
steffnay
reviewed
Jun 1, 2022
steffnay
reviewed
Jun 1, 2022
steffnay
reviewed
Jun 1, 2022
steffnay
reviewed
Jun 1, 2022
| self.to_delete.insert(0, table) | ||
|
|
||
| # job_config = bigquery.LoadJobConfig() | ||
| job_config = bigquery.LoadJobConfig() |
Contributor
There was a problem hiding this comment.
Add table as destination so it will be created during the load job
steffnay
reviewed
Jun 1, 2022
steffnay
reviewed
Jun 1, 2022
steffnay
reviewed
Jun 1, 2022
chalmerlowe
reviewed
May 22, 2023
| if job_config.schema is None: | ||
| # make table id | ||
| # table_id = "your-project.your_dataset.your_table" | ||
| destination = _table_arg_to_table_ref(destination, default_project=self.project) |
Collaborator
There was a problem hiding this comment.
Why are we calling _table_arg_to_table_ref() here?
The very first line of get_table() calls that function.
def get_table(
self,
table: Union[Table, TableReference, TableListItem, str],
retry: retries.Retry = DEFAULT_RETRY,
timeout: TimeoutType = DEFAULT_TIMEOUT,
) -> Table:
""" REMOVED DOCSTRING FOR SPACE """
table_ref = _table_arg_to_table_ref(table, default_project=self.project)
Contributor
|
Closing in favor of googleapis/google-cloud-python#15720. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1228 🦕