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

Fix np.where logic in table.join #9313

Merged
merged 5 commits into from Oct 4, 2019
Merged

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Oct 4, 2019

This regression was unearthed while doing #9287, and thus be opened as a separate PR to be able to backport the fix.

@bsipocz bsipocz added this to the v2.0.15 milestone Oct 4, 2019
@astropy-bot astropy-bot bot added the table label Oct 4, 2019
@bsipocz bsipocz added the Bug label Oct 4, 2019
if np.any(right_mask):
out[out_name][right_mask] = right[right_name].take(right_out)
out[out_name] = left[left_name].take(left_out)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? And should this not be an in-place change at least? (with [:])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, it should use [:]. As for the rest of the changes, I did the fix to follow the very same logic as the np.where above (the issue with that it doesn't understand Quantities for np <1.17 and astropy <4.0):

                out[out_name][:] = np.where(right_mask,
                                            left[left_name].take(left_out),
                                            right[right_name].take(right_out))

@bsipocz
Copy link
Member Author

bsipocz commented Oct 4, 2019

(a rebase has solved the weird appveyor issue, so if we don't see it popping up elsewhere we are good)

@bsipocz bsipocz requested a review from astrofrog October 4, 2019 17:37
Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good with @astrofrog's comment addressed, so approving.

@mhvk mhvk merged commit d280767 into astropy:master Oct 4, 2019
bsipocz pushed a commit that referenced this pull request Oct 5, 2019
bsipocz pushed a commit that referenced this pull request Oct 5, 2019
bsipocz pushed a commit that referenced this pull request Oct 7, 2019
bsipocz pushed a commit that referenced this pull request Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants