Skip to content

skipmissing on Dict: inconsistent results #48379

@aplavin

Description

@aplavin

I noticed a pretty weird and very hard to catch inconsistency:

julia> d = Dict(:x => 1, :y => 2, :z => 0)

julia> argmax(d)
:y

julia> argmax(skipmissing(d))
:z

No matter how one interprets dicts iteration and skipmissing semantics, this result is totally unexpected.

The return type is correct, so this may lead to very nasty bugs in user code.

Is that a bug in Julia? Something should probably throw an error here, if dicts + skipmissing are not supported...

Some discussion on slack: https://julialang.slack.com/archives/C67910KEH/p1674391331249859.

Metadata

Metadata

Assignees

No one assigned

    Labels

    collectionsData structures holding multiple items, e.g. setsmissing dataBase.missing and related functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions