Skip to content

ArgumentError: invalid value for BigDecimal(): "N/A" #13

Closed

Description

@beet

Steps to reproduce:

When attempting to produce an export when a test is present without enough participants to calculate the statistical confidence, exports raise an exception attempting to convert the string "N/A" to a float.

> csv_data = Split::Export.to_csv
ArgumentError: invalid value for BigDecimal(): "N/A"
from /Users/markb/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/split-export-2.0.0/lib/split/export.rb:10:in `initialize'

Could it convert the number to an integer instead of a string to give a value of 0.0?

[5] pry(main)> BigDecimal.new("NA".to_i).round(2).to_f
=> 0.0

Activity

  1. andrew commented on Oct 3, 2017

    @andrew
    Member

    @beet maybe we should just rescue and return the string instead?

  2. beet commented on Oct 3, 2017

    @beet
    Author

    @andrew great idea.

    I was going to create a fork, but rake spec fails with:

    NameError:
      uninitialized constant RSpec::Expectations::MultipleExpectationsNotMetError
    # ./spec/export_spec.rb:3:in `<top (required)>'
    

    Tried upgrading rspec to 3.x, but can't get the tests to run.

  3. nhippenmeyer commented on Nov 17, 2017

    @nhippenmeyer

    I'm also seeing this exception for tests that have reached statistical significance. Can a patch be released to fix this bug?

  4. added a commit that references this issue on Jul 18, 2018
  5. added a commit that references this issue on Jul 19, 2018
  6. andrew commented on Jul 19, 2018

    @andrew
    Member

    Fixed in #18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions