@@ -1953,44 +1953,60 @@ class ReadCsvKwargs(TypedDict):
1953
1953
),
1954
1954
pd .DataFrame ,
1955
1955
)
1956
- parse_dates_2 = {"combined_date" : ["Year" , "Month" , "Day" ]}
1957
- with pytest_warns_bounded (
1958
- FutureWarning , "Support for nested sequences" , lower = "2.1.99"
1959
- ):
1960
- check (
1961
- assert_type (pd .read_csv (path , parse_dates = parse_dates_2 ), pd .DataFrame ),
1962
- pd .DataFrame ,
1963
- )
1964
- parse_dates_3 = {"combined_date" : [1 , 2 , 3 ]}
1965
- with pytest_warns_bounded (
1966
- FutureWarning , "Support for nested sequences" , lower = "2.1.99"
1967
- ):
1968
- check (
1969
- assert_type (pd .read_csv (path , parse_dates = parse_dates_3 ), pd .DataFrame ),
1970
- pd .DataFrame ,
1971
- )
1972
- # MyPy calls this Dict[str, object] by default which necessitates the explicit annotation (Pyright does not)
1973
- parse_dates_4 : dict [str , list [str | int ]] = {"combined_date" : [1 , "Month" , 3 ]}
1974
- with pytest_warns_bounded (
1975
- FutureWarning , "Support for nested sequences" , lower = "2.1.99"
1976
- ):
1977
- check (
1978
- assert_type (pd .read_csv (path , parse_dates = parse_dates_4 ), pd .DataFrame ),
1979
- pd .DataFrame ,
1980
- )
1956
+ if PD_LTE_22 :
1957
+ parse_dates_2 = {"combined_date" : ["Year" , "Month" , "Day" ]}
1958
+ with pytest_warns_bounded (
1959
+ FutureWarning ,
1960
+ "Support for nested sequences" ,
1961
+ lower = "2.1.99" ,
1962
+ ):
1963
+ check (
1964
+ assert_type (
1965
+ pd .read_csv (path , parse_dates = parse_dates_2 ), pd .DataFrame
1966
+ ),
1967
+ pd .DataFrame ,
1968
+ )
1969
+ parse_dates_3 = {"combined_date" : [1 , 2 , 3 ]}
1970
+ with pytest_warns_bounded (
1971
+ FutureWarning , "Support for nested sequences" , lower = "2.1.99"
1972
+ ):
1973
+ check (
1974
+ assert_type (
1975
+ pd .read_csv (path , parse_dates = parse_dates_3 ), pd .DataFrame
1976
+ ),
1977
+ pd .DataFrame ,
1978
+ )
1979
+ # MyPy calls this Dict[str, object] by default which necessitates the explicit annotation (Pyright does not)
1980
+ parse_dates_4 : dict [str , list [str | int ]] = {
1981
+ "combined_date" : [1 , "Month" , 3 ]
1982
+ }
1983
+ with pytest_warns_bounded (
1984
+ FutureWarning , "Support for nested sequences" , lower = "2.1.99"
1985
+ ):
1986
+ check (
1987
+ assert_type (
1988
+ pd .read_csv (path , parse_dates = parse_dates_4 ), pd .DataFrame
1989
+ ),
1990
+ pd .DataFrame ,
1991
+ )
1992
+
1993
+ parse_dates_6 = [[1 , 2 , 3 ]]
1994
+ with pytest_warns_bounded (
1995
+ FutureWarning ,
1996
+ "Support for nested sequences" ,
1997
+ lower = "2.1.99" ,
1998
+ ):
1999
+ check (
2000
+ assert_type (
2001
+ pd .read_csv (path , parse_dates = parse_dates_6 ), pd .DataFrame
2002
+ ),
2003
+ pd .DataFrame ,
2004
+ )
1981
2005
parse_dates_5 = [0 ]
1982
2006
check (
1983
2007
assert_type (pd .read_csv (path , parse_dates = parse_dates_5 ), pd .DataFrame ),
1984
2008
pd .DataFrame ,
1985
2009
)
1986
- parse_dates_6 = [[1 , 2 , 3 ]]
1987
- with pytest_warns_bounded (
1988
- FutureWarning , "Support for nested sequences" , lower = "2.1.99"
1989
- ):
1990
- check (
1991
- assert_type (pd .read_csv (path , parse_dates = parse_dates_6 ), pd .DataFrame ),
1992
- pd .DataFrame ,
1993
- )
1994
2010
1995
2011
1996
2012
def test_groupby_series_methods () -> None :
0 commit comments