-
-
Couldn't load subscription status.
- Fork 150
Open
Labels
ConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsIndexRelated to the Index class or subclassesRelated to the Index class or subclasses
Description
On 01d597f, the stubs give Index[Timestamp] when providing a DatetimeIndex as data. The result should be DatetimeIndex.
import pandas as pd
from tests import check
from typing import assert_type
data = check(
assert_type(pd.date_range("2022-01-01", "2022-01-31", freq="D"), pd.DatetimeIndex),
pd.DatetimeIndex, # fine
)
check(
assert_type(pd.Index(data, name="date"), "pd.Index[pd.Timestamp]"), pd.DatetimeIndex # static typing is wrong
)This affects test_index_relops.
Metadata
Metadata
Assignees
Labels
ConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsIndexRelated to the Index class or subclassesRelated to the Index class or subclasses