-
-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorAstypeConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsIndexRelated to the Index class or subclassesRelated to the Index class or subclassesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further actionRoadmapA proposal for the roadmap.A proposal for the roadmap.SeriesSeries data structureSeries data structure
Description
At the moment, nullable Pandas dtypes in Series are recognised as their non-nullable counterparts.
Can we make the stubs revealing the distinctions?
from typing import assert_type
import pandas as pd
assert_type(pd.Series([1], dtype="Int64"), "pd.Series[pd.Int64Dtype]") # recognised as pd.Series[int]
assert_type(pd.Series([True], dtype="boolean"), "pd.Series[pd.BooleanDtype]") # recognised as pd.Series[bool]
assert_type(pd.Series([1]).astype("Int64"), "pd.Series[pd.Int64Dtype]") # recognised as pd.Series[int]
assert_type(pd.Series([True]).astype("boolean"), "pd.Series[pd.BooleanDtype]") # recognised as pd.Series[bool]
Metadata
Metadata
Assignees
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorAstypeConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsIndexRelated to the Index class or subclassesRelated to the Index class or subclassesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further actionRoadmapA proposal for the roadmap.A proposal for the roadmap.SeriesSeries data structureSeries data structure