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

error occurs when there is the null field #6

Open
maeken2010 opened this issue Sep 13, 2017 · 1 comment
Open

error occurs when there is the null field #6

maeken2010 opened this issue Sep 13, 2017 · 1 comment

Comments

@maeken2010
Copy link

Hi

I'm using this tool for some csv files.
then, I discover that error occurs when there is the null field.
For example, if specifying these csv files, occurs NoMethodError.

a.csv

ID,description,
1,hoge,
2,huga,
3,poyo,

b.csv

ID,description
1,hoge
2,huge
3,piyo
diff = CSVDiff.new("a.csv", "b.csv")
NoMethodError: undefined method `upcase' for nil:NilClass

I think, to need rename fild nil to "NULL" in CSVSource.
But, I dont think it's the best solution.

@0x53A
Copy link

0x53A commented Dec 21, 2017

I have the same issue (using https://github.com/agardiner/csv-diff-report as the front-end):

/home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-0.3.3/lib/csv-diff/csv_diff.rb:154:in `block in get_diff_fields': undefined method `upcase' for nil:NilClass (NoMethodError)
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-0.3.3/lib/csv-diff/csv_diff.rb:154:in `reject'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-0.3.3/lib/csv-diff/csv_diff.rb:154:in `get_diff_fields'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-0.3.3/lib/csv-diff/csv_diff.rb:89:in `initialize'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-report-0.3.4/lib/csv-diff-report/report.rb:221:in `new'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-report-0.3.4/lib/csv-diff-report/report.rb:221:in `diff_file'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-report-0.3.4/lib/csv-diff-report/report.rb:87:in `diff'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-report-0.3.4/lib/csv-diff-report/cli.rb:131:in `process'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-report-0.3.4/lib/csv-diff-report/cli.rb:101:in `run'
        from /home/lr/.rvm/gems/ruby-2.4.1/gems/csv-diff-report-0.3.4/bin/csvdiff:7:in `<top (required)>'
        from /home/lr/.rvm/gems/ruby-2.4.1/bin/csvdiff:23:in `load'
        from /home/lr/.rvm/gems/ruby-2.4.1/bin/csvdiff:23:in `<main>'
        from /home/lr/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
        from /home/lr/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants