Skip to content

Conversation

@MarkusBonsch
Copy link
Contributor

Closes #2372.
In my original implementation,
indices were treated like keys, i.e. on assining, they were shortened to the unaltered columns.
This could cause unexpected reordering during subsets.
The new implementation fixes the issue by doing the following if an index column has been assigned to:

  • if the index has length(idx)>0, it is dropped.
  • if the index is integer(0), it is shortened to the unaltered columns because no reordering can occur.

This rarely has practical implications at the moment but is important for consistency and potential extended use of indices in the future.

@codecov-io
Copy link

codecov-io commented Oct 5, 2017

Codecov Report

Merging #2401 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2401      +/-   ##
==========================================
- Coverage   91.34%   91.32%   -0.03%     
==========================================
  Files          62       62              
  Lines       12023    12025       +2     
==========================================
- Hits        10983    10982       -1     
- Misses       1040     1043       +3
Impacted Files Coverage Δ
src/assign.c 94.3% <100%> (+0.18%) ⬆️
src/forder.c 93.94% <0%> (-0.53%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6968a0e...4c21c3f. Read the comment docs.

@mattdowle mattdowle self-requested a review October 5, 2017 19:20
@mattdowle mattdowle merged commit 0375cfa into master Oct 5, 2017
@mattdowle mattdowle deleted the assignRetainsKeyFixed branch October 5, 2017 19:21
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

Successfully merging this pull request may close these issues.

[Request] assigning with := should retain keys better

3 participants