As of 4.1.3 a DBF::NoColumnsDefined error will be raised when attempting to read records if no columns are defined
However, we see:
no implicit conversion of nil into String
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/record.rb:11:in `initialize'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/record.rb:11:in `new'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/record.rb:11:in `initialize'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:191:in `new'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:191:in `record'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:120:in `block in each'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:120:in `times'
/var/www/careright/shared/bundle/ruby/2.6.0/gems/dbf-4.2.4/lib/dbf/table.rb:120:in `each'
/var/www/careright/releases/20231212045615/app/models/lookup.rb:506:in `import!'
Ideally, instantiating a record with data: nil would raise an argument error or similar, and reading a table + trying to instantiate a record wouldn't occur if it wasn't valid OR it raises a meaningful exception.
DBF Data:
Can't attach here unfortunately (licencing). I suspect we're managing to pass in nulls/invalid data/etc.
Basically the same kind of issue as #90 and https://github.com/infused/dbf/pull/91
The comment on that PR is:
However, we see:
Ideally, instantiating a record with data: nil would raise an argument error or similar, and reading a table + trying to instantiate a record wouldn't occur if it wasn't valid OR it raises a meaningful exception.
DBF Data: Can't attach here unfortunately (licencing). I suspect we're managing to pass in nulls/invalid data/etc.