ookamiinc / twitter-analytics-acquirer

0 stars 0 forks source link

Add escape process when parsing csv #10

Closed yusuko closed 5 years ago

yusuko commented 5 years ago

What

yusuko commented 5 years ago

I face csv illegal quoting error in production.

What I intend

  1. I try to solve this by using liberal_parsing option.
  2. If I cannot solve this by 1, I will write escape process by using code such as gsub.
/app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1912:in `block (2 levels) in shift': Illegal quoting in line 2. (CSV::MalformedCSVError)
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1868:in `each'
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1868:in `block in shift'
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1828:in `loop'
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1828:in `shift'
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1770:in `each'
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1784:in `to_a'
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1784:in `read'
    from /app/vendor/ruby-2.4.4/lib/ruby/2.4.0/csv.rb:1324:in `parse'
    from /app/google_sheet_client.rb:16:in `write_in_spreadsheet'
    from script.rb:14:in `block in <main>'
    from script.rb:9:in `each'
    from script.rb:9:in `<main>'