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 importing data when open/close hour column fields value is 0 #166

Open
pmallol opened this issue Jan 21, 2019 · 0 comments
Open

Error importing data when open/close hour column fields value is 0 #166

pmallol opened this issue Jan 21, 2019 · 0 comments

Comments

@pmallol
Copy link
Contributor

pmallol commented Jan 21, 2019

version: 0.3.2-dev-631e732 (build 418)

  1. Go to https://aslm1-stg.instedd.org/datasets
  2. Login
  3. Inside the ONA tab, drag and drop your local data.csv file on top of the "data.csv" square and wait for it to upload
  4. Click on IMPORT button

Obtained:
The following error:

I, [2019-01-21T18:15:05.004937 #5222]  INFO -- : Generating facilities.csv file
/app/app/models/convert_from_ona.rb:92:in `get_hours': undefined method `slice' for 0:Fixnum (NoMethodError)
	from /app/app/models/convert_from_ona.rb:61:in `get_opening_hours'
	from /app/app/models/convert_from_ona.rb:56:in `block in get_opening_hours_array'
	from /app/app/models/convert_from_ona.rb:56:in `map'
	from /app/app/models/convert_from_ona.rb:56:in `get_opening_hours_array'
	from /app/app/models/convert_from_ona.rb:43:in `block in convert'
	from /app/app/models/convert_from_ona.rb:120:in `<<'
	from /app/app/models/convert_from_ona.rb:120:in `block (2 levels) in csv_enumerator'
	from /usr/local/lib/ruby/2.3.0/csv.rb:1748:in `each'
	from /usr/local/lib/ruby/2.3.0/csv.rb:1131:in `block in foreach'
	from /usr/local/lib/ruby/2.3.0/csv.rb:1282:in `open'
	from /usr/local/lib/ruby/2.3.0/csv.rb:1130:in `foreach'
	from /app/app/models/convert_from_ona.rb:119:in `block in csv_enumerator'
	from /app/app/models/convert_from_ona.rb:30:in `each'
	from /app/app/models/convert_from_ona.rb:30:in `each'
	from /app/app/models/convert_from_ona.rb:30:in `convert'
	from /app/app/models/convert_from_ona.rb:105:in `convert_dataset'
	from /app/bin/convert-from-ona:17:in `import'
	from /app/bin/convert-from-ona:21:in `<main>'

File used in this test case: FPP-Import data.xlsx

Expected:
This field should accept integers as well as strings.
Also, it would be useful if the error was more explicit and informed the user the exact column and cell causing the error.

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

No branches or pull requests

1 participant