Skip to content

Commit bcaf37e

Browse files
committed
Autodetect arrays of storage urls
1 parent d231249 commit bcaf37e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • google-cloud-bigquery/lib/google/cloud/bigquery

google-cloud-bigquery/lib/google/cloud/bigquery/table.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ def load file, format: nil, create: nil, write: nil,
674674
skip_leading: skip_leading, dryrun: dryrun }
675675
return load_storage(file, options) if storage_url? file
676676
return load_local(file, options) if local_file? file
677+
return load_storage_multiple(file, options) if multiple_storage_url? file
677678
fail Google::Cloud::Error, "Don't know how to load #{file}"
678679
end
679680

@@ -809,6 +810,10 @@ def load_local file, options = {}
809810
Job.from_gapi gapi, service
810811
end
811812

813+
def multiple_storage_url? files
814+
files.respond_to?(:all?) && files.all? {|file| self.storage_url? file}
815+
end
816+
812817
def storage_url? file
813818
file.respond_to?(:to_gs_url) ||
814819
(file.respond_to?(:to_str) &&

0 commit comments

Comments
 (0)