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

Cannot map datatable headers if one header is a prefix of another #1450

Closed
mrdaniellewis opened this issue Jul 21, 2020 · 3 comments · Fixed by #1598
Closed

Cannot map datatable headers if one header is a prefix of another #1450

mrdaniellewis opened this issue Jul 21, 2020 · 3 comments · Fixed by #1598
Labels
🐛 bug Defect / Bug 🧷 pinned Tells Stalebot not to close this issue

Comments

@mrdaniellewis
Copy link

Describe the bug

An error is raised for map_headers on a DataTable if one header value is a prefix of another header value.

To Reproduce

DataTable.from([["ant", "anteater"], [1, 2]]).map_headers { |h| h.capitalize }.hashes
# RuntimeError Exception: 2 headers matched "ant": ["ant", "anteater"]

Expected behavior
[{"Ant"=>1, "Anteater"=>2}]

Your Environment

Ruby 2.6.6p146
Cucumber 4.1.0

Additional context

Appears to be due to this PR: 7b98250#diff-0466a7e3105b8e1a9e19cb8b0750f74fR510

@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

@stale stale bot added the ⌛ stale Will soon be closed by stalebot unless there is activity label Sep 20, 2020
@luke-hill luke-hill added 🧷 pinned Tells Stalebot not to close this issue and removed ⌛ stale Will soon be closed by stalebot unless there is activity labels Sep 21, 2020
@aslakhellesoy aslakhellesoy added the 🐛 bug Defect / Bug label Feb 2, 2021
@gleonet
Copy link

gleonet commented Aug 25, 2021

Same issue

RuntimeError Exception: 3 headers matched "name": ["name", "short_name", "full_name"]

Is there a solution? Or a better way to map the headers?

@luke-hill
Copy link
Contributor

This is something I need to fix. We have identified the problematic area. I can try work on this in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug 🧷 pinned Tells Stalebot not to close this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants