Skip to content

Remove "no non-missing" warning for character min and max? #4999

@mattdowle

Description

@mattdowle

When looking at gsumm.c for recent PR, this warning struck me as unnecessary :

> DT
        a     b
   <char> <int>
1:   <NA>     1
2:   <NA>     2
> DT[, min(a, na.rm=TRUE), by=b]
       b     V1
   <int> <char>
1:     1   <NA>
2:     2   <NA>
Warning message:
In gmin(a, na.rm = TRUE) :
  No non-missing values found in at least one group. Returning 'NA' for such groups to be consistent with base

Can we just remove the warning? I can imagine that the warning is more annoying when it does occur, than being appreciated. A secondary motivation is that there is an extra loop through the result just to generate that warning, so that loop could be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions