Closed jmao-denver closed 3 weeks ago
@devinrsmith wondered if we should make numpy
a soft (optional) dependency. I guess we could use a pattern like the following but the body of unique
also references specific numpy
types, which requires more code branches and I don't think it is worth the effort.
if np is None:
Sentinel_Type = Union[str, bool]
else:
Sentinel_Type = Union[np.number, str, bool]
def unique(cols: Union[str, List[str]] = None, include_nulls: bool = False,
non_unique_sentinel: Sentinel_Type = None) -> Aggregation:
@devinrsmith wondered if we should make
numpy
a soft (optional) dependency. I guess we could use a pattern like the following but the body ofunique
also references specificnumpy
types, which requires more code branches and I don't think it is worth the effort.if np is None: Sentinel_Type = Union[str, bool] else: Sentinel_Type = Union[np.number, str, bool] def unique(cols: Union[str, List[str]] = None, include_nulls: bool = False, non_unique_sentinel: Sentinel_Type = None) -> Aggregation:
Is this the only feature we require numpy for? If so, I'm OK with the optional route.
numpy
optional, however the ROI isn't high considering the changes we need to make to the code and the doc for such a common lib
and clean up setup.py a bit
Fixes #6304