From 4ba21d8534173b45b42995c4dac73914f1de6140 Mon Sep 17 00:00:00 2001 From: Grant Timmerman <granttimmerman@gmail.com> Date: Fri, 14 Jun 2019 11:46:56 -0700 Subject: [PATCH 1/2] Use autodetected location. See b/116968956 --- bigquery/snippets/load_from_file.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/bigquery/snippets/load_from_file.rb b/bigquery/snippets/load_from_file.rb index 03eacdde3..7337c92a6 100644 --- a/bigquery/snippets/load_from_file.rb +++ b/bigquery/snippets/load_from_file.rb @@ -24,8 +24,6 @@ def load_from_file(dataset_id = "your_dataset_id", load_job = dataset.load_job table_id, file_path do |config| config.skip_leading = 1 config.autodetect = true - # Must match the destination dataset location. - config.location = "US" end load_job.wait_until_done! # Waits for table load to complete. From 3ec9c7860e890ead546bb42eefc679a462592c12 Mon Sep 17 00:00:00 2001 From: Grant Timmerman <granttimmerman@gmail.com> Date: Thu, 20 Jun 2019 10:13:46 -0700 Subject: [PATCH 2/2] Update load_from_file.rb --- bigquery/snippets/load_from_file.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/bigquery/snippets/load_from_file.rb b/bigquery/snippets/load_from_file.rb index 7337c92a6..e96f3d9a0 100644 --- a/bigquery/snippets/load_from_file.rb +++ b/bigquery/snippets/load_from_file.rb @@ -21,6 +21,7 @@ def load_from_file(dataset_id = "your_dataset_id", dataset = bigquery.dataset dataset_id table_id = "new_table_id" + # Infer the config.location based on the location of the referenced dataset. load_job = dataset.load_job table_id, file_path do |config| config.skip_leading = 1 config.autodetect = true