8000 BUG: Do not inherit flags from the structured part of a union dtype by seberg · Pull Request #16817 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Do not inherit flags from the structured part of a union dtype #16817

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

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

seberg
Copy link
Member
@seberg seberg commented Jul 12, 2020

Such a union dtype (I would like to just not have them...) should
behave like the main dtype normally. The only use of the union
part should be to allow field access. In all other cases behaviour
should not be affected by the existance of fields, but inheriting
fields will affect it.
The exception is the void dtype, which explicitly uses its fields
and thus must inherit flags from the contained dtypes.


This fixes an annoying bug with such union dtypes (specifically union of objects), which came back to bite me in another cleanup (for, quite honestly reasons I did not yet understand). In any case, I am sure that this is the right way to do handle it here. Union dtypes are weird, and I would like them not existing, but tagging on fields to a dtype should definitely not change its main behaviour.

Such a union dtype (I would like to just not have them...) should
behave like the main dtype normally.  The only use of the union
part should be to allow field access.  In all other cases behaviour
should not be affected by the existance of fields, but inheriting
fields will affect it.
The exception is the `void` dtype, which explicitly uses its fields
and thus must inherit flags from the contained dtypes.
@seberg
Copy link
Member Author
seberg commented Jul 12, 2020

Hmmm, the azure error is about distutils being imported, on PyPy we actually skip giving the warning/testing here. Did azure setup just change to somehow end up always importing distutils here?

@mattip
Copy link
Member
mattip commented Jul 12, 2020

close/open to clear the azure error

@mattip mattip closed this Jul 12, 2020
@mattip mattip reopened this Jul 12, 2020
Copy link
Member
@mattip mattip left a comment

Choose a reason for hiding this comment

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

LGTM once CI passes

@charris
Copy link
Member
charris commented Jul 13, 2020

Not sure what is going on with shippable.

3 failed, 10949 passed, 33 skipped, 19 xfailed, 3 xpassed, 2 warnings, 386 errors in 628.40s (0:10:28)

Let's try again.

@seberg
Copy link
Member Author
seberg commented Jul 13, 2020

Thanks for having a look matti. I will put this in, CI is passing now (aside from the Shippable issue).

@seberg seberg merged commit 41ccadd into numpy:master Jul 13, 2020
@seberg seberg deleted the union-dtype-flags branch July 13, 2020 15:24
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.

3 participants
0