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

Raise actually informative error if conditions passed to RowSelector result in non-array #123

Open
kspurgin opened this issue Oct 26, 2022 · 0 comments

Comments

@kspurgin
Copy link
Collaborator

kspurgin commented Oct 26, 2022

Without this, we get an uninformative mess like:

/Users/kristina/code/mig/kiba-extend/lib/kiba/extend/utils/fieldset.rb:51:in `fetch': no implicit conversion of Symbol into Integer (TypeError)
	from /Users/kristina/code/mig/kiba-extend/lib/kiba/extend/utils/fieldset.rb:51:in `block in get_field_values'
	from /Users/kristina/code/mig/kiba-extend/lib/kiba/extend/utils/fieldset.rb:49:in `each'
	from /Users/kristina/code/mig/kiba-extend/lib/kiba/extend/utils/fieldset.rb:49:in `get_field_values'
	from /Users/kristina/code/mig/kiba-extend/lib/kiba/extend/utils/fieldset.rb:35:in `block in populate'
	from /Users/kristina/code/mig/kiba-extend/lib/kiba/extend/utils/fieldset.rb:35:in `each'
	from /Users/kristina/code/mig/kiba-extend/lib/kiba/extend/utils/fieldset.rb:35:in `populate'
	from /Users/kristina/code/mig/kiba-extend/lib/kiba/extend/transforms/merge/multi_row_lookup.rb:88:in `block in process'

Example of bad conditions lambda:

conditions: ->(_r, rows) do
  res = rows.select{ |row| row[:contype] == 'Organization' }
  res.empty? ? res :  res.first
end
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

1 participant