Skip to content

Fix error messages for ranges with missing #46245

@bkamins

Description

@bkamins

@nalimilan - this is a common error.

First a case when I think error message is OK (or at least acceptable):

julia> missing:1:missing
ERROR: TypeError: non-boolean (Missing) used in boolean context

Now a case when new users will be confused:

julia> missing:0.1:missing
ERROR: ArgumentError: StepRange should not be used with floating point

Source why it is common:

julia> x = [missing, 1.1, 0.3]
3-element Vector{Union{Missing, Float64}}:
  missing
 1.1
 0.3

julia> minimum(x):0.1:maximum(x) # clearly skipmisssing should be used but it is not obvious to the user
ERROR: ArgumentError: StepRange should not be used with floating point

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagesBetter, more actionable error messagesmissing 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