-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Detect missing
in Dict
constructor
#25551
Comments
Yes, that inconsistency is annoying. It could be worth thinking more generally about whether it's OK that |
Actually, looks like |
Yes, but I would update constructors after we have a target behavior of |
The |
I have a related question (I could not locate it discussed; if it was and there is some conclusions or if there is a better place to discuss it I would be obliged if you let me know). The problem is that
|
Sorry - now I see - it is #25423 - right? |
Yes, that's it. |
See #25661. |
See #25805 for the |
We have that array constructors correctly detect
missing
and create a properUnion
type of the resulting object:However,
Dict
constructor does not follow this pattern and usesAny
:but if we wrap the pairs in a vector it does:
My proposal is to make
Dict
constructors consistent and always create an appropriateUnion
.I see the reason in the source code why currently we have this bad behavior, i.e.
eltype
for<:Tuple
usestypejoin
and notpromote_type
(like arrays do), but I could not find any efficient way to fix it.Of course
eltype
fortuple
should usetypejoin
, but then maybetypejoin(::Missing,T)
should returnUnion{Missing, T}
if!(T>:Missing)
. I do not know if this was discussed and this is breaking.CC @nalimilan
The text was updated successfully, but these errors were encountered: