Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CSV mime type #2286

Merged
merged 1 commit into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi("some/file/path.csv"),
[project, load_job_gapi(table_reference, "CSV"), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_gapi(table_reference, "CSV"), upload_source: file, content_type: "text/csv"]

job = dataset.load_job table_id, file, format: :csv
job.must_be_kind_of Google::Cloud::Bigquery::LoadJob
Expand All @@ -46,7 +46,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi("some/file/path.csv"),
[project, load_job_csv_options_gapi(table_reference), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_csv_options_gapi(table_reference), upload_source: file, content_type: "text/csv"]

job = dataset.load_job table_id, file, format: :csv, jagged_rows: true, quoted_newlines: true, autodetect: true,
encoding: "ISO-8859-1", delimiter: "\t", ignore_unknown: true, max_bad_records: 42, null_marker: "\N",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi("some/file/path.csv"),
[project, load_job_gapi(table_reference, "CSV"), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_gapi(table_reference, "CSV"), upload_source: file, content_type: "text/csv"]

result = dataset.load table_id, file, format: :csv
result.must_equal true
Expand All @@ -46,7 +46,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi("some/file/path.csv"),
[project, load_job_csv_options_gapi(table_reference), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_csv_options_gapi(table_reference), upload_source: file, content_type: "text/csv"]

result = dataset.load table_id, file, format: :csv, jagged_rows: true, quoted_newlines: true, autodetect: true,
encoding: "ISO-8859-1", delimiter: "\t", ignore_unknown: true, max_bad_records: 42, null_marker: "\N",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi(table, "some/file/path.csv"),
[project, load_job_gapi(table_gapi.table_reference, "CSV"), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_gapi(table_gapi.table_reference, "CSV"), upload_source: file, content_type: "text/csv"]

job = table.load_job file, format: :csv
job.must_be_kind_of Google::Cloud::Bigquery::LoadJob
Expand All @@ -45,7 +45,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi(table, "some/file/path.csv"),
[project, load_job_csv_options_gapi(table_gapi.table_reference), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_csv_options_gapi(table_gapi.table_reference), upload_source: file, content_type: "text/csv"]

job = table.load_job file, format: :csv, jagged_rows: true, quoted_newlines: true, autodetect: true,
encoding: "ISO-8859-1", delimiter: "\t", ignore_unknown: true, max_bad_records: 42, null_marker: "\N",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi(table, "some/file/path.csv"),
[project, load_job_gapi(table_gapi.table_reference, "CSV"), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_gapi(table_gapi.table_reference, "CSV"), upload_source: file, content_type: "text/csv"]

result = table.load file, format: :csv
result.must_equal true
Expand All @@ -44,7 +44,7 @@

temp_csv do |file|
mock.expect :insert_job, load_job_resp_gapi(table, "some/file/path.csv"),
[project, load_job_csv_options_gapi(table_gapi.table_reference), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_csv_options_gapi(table_gapi.table_reference), upload_source: file, content_type: "text/csv"]

result = table.load file, format: :csv, jagged_rows: true, quoted_newlines: true, autodetect: true,
encoding: "ISO-8859-1", delimiter: "\t", ignore_unknown: true, max_bad_records: 42, null_marker: "\N",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
job_resp_gapi = load_job_resp_gapi(table, "some/file/path.csv")
job_resp_gapi.status = status "done"
mock.expect :insert_job, job_resp_gapi,
[project, load_job_gapi(table_gapi.table_reference, "CSV", location: nil), upload_source: file, content_type: "text/comma-separated-values"]
[project, load_job_gapi(table_gapi.table_reference, "CSV", location: nil), upload_source: file, content_type: "text/csv"]

result = table.load file, format: :csv
result.must_equal true
Expand Down