Skip to content

Commit 9875a85

Browse files
committed
FIXED: inconsistency for import_data_from_uris between documentation and actual code
1 parent 43e61c1 commit 9875a85

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bigquery/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def import_data_from_uris(
469469
configuration['encoding'] = encoding
470470

471471
if schema:
472-
configuration['schema'] = schema
472+
configuration['schema'] = {'fields': schema}
473473

474474
if source_format:
475475
configuration['sourceFormat'] = source_format

bigquery/tests/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def test_csv_job_body_constructed_correctly(self):
578578
"configuration": {
579579
"load": {
580580
"sourceUris": ["sourceuri"],
581-
"schema": ["schema"],
581+
"schema": {"fields": ["schema"]},
582582
"destinationTable": {
583583
"projectId": self.project_id,
584584
"datasetId": self.dataset_id,
@@ -637,7 +637,7 @@ def test_json_job_body_constructed_correctly(self):
637637
"configuration": {
638638
"load": {
639639
"sourceUris": ["sourceuri"],
640-
"schema": ["schema"],
640+
"schema": {"fields": ["schema"]},
641641
"destinationTable": {
642642
"projectId": self.project_id,
643643
"datasetId": self.dataset_id,
@@ -732,7 +732,7 @@ def test_accepts_single_source_uri(self):
732732
"configuration": {
733733
"load": {
734734
"sourceUris": ["sourceuri"],
735-
"schema": ["schema"],
735+
"schema": {"fields": ["schema"]},
736736
"destinationTable": {
737737
"projectId": self.project_id,
738738
"datasetId": self.dataset_id,

0 commit comments

Comments
 (0)