Skip to content

Commit

Permalink
Revert smarter_csv duplicate header behavior to version 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
moveson committed Mar 14, 2024
1 parent 341c11d commit 4beead8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/etl/extractors/csv_file_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ class CsvFileStrategy
BYTE_ORDER_MARK = String.new("\xEF\xBB\xBF").force_encoding("UTF-8").freeze
IMPORT_OPTIONS = {
downcase_header: false,
duplicate_header_suffix: nil,
force_utf8: true,
remove_empty_values: false,
row_sep: :auto,
strip_chars_from_headers: BYTE_ORDER_MARK,
strings_as_keys: true
strings_as_keys: true,
}.freeze

attr_reader :errors
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/etl/extractors/csv_file_strategy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

error = subject.errors.first
expect(error[:title]).to eq("CSV error")
expect(error[:detail][:messages]).to include("ERROR: duplicate headers: country,country")
expect(error[:detail][:messages]).to include('Duplicate Headers in CSV: {"country"=>2}')
end
end
end
Expand Down

0 comments on commit 4beead8

Please sign in to comment.