Skip to content

Commit b2055b1

Browse files
authored
CLN: remove checks for python < 3.8 (#44223)
1 parent 66ce5de commit b2055b1

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

pandas/_libs/tslibs/timestamps.pyi

+5-21
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ from datetime import (
55
timedelta,
66
tzinfo as _tzinfo,
77
)
8-
import sys
98
from time import struct_time
109
from typing import (
1110
ClassVar,
@@ -89,16 +88,8 @@ class Timestamp(datetime):
8988
def today(cls: Type[_S]) -> _S: ...
9089
@classmethod
9190
def fromordinal(cls: Type[_S], n: int) -> _S: ...
92-
if sys.version_info >= (3, 8):
93-
@classmethod
94-
def now(cls: Type[_S], tz: _tzinfo | str | None = ...) -> _S: ...
95-
else:
96-
@overload
97-
@classmethod
98-
def now(cls: Type[_S], tz: None = ...) -> _S: ...
99-
@overload
100-
@classmethod
101-
def now(cls, tz: _tzinfo) -> datetime: ...
91+
@classmethod
92+
def now(cls: Type[_S], tz: _tzinfo | str | None = ...) -> _S: ...
10293
@classmethod
10394
def utcnow(cls: Type[_S]) -> _S: ...
10495
@classmethod
@@ -129,10 +120,7 @@ class Timestamp(datetime):
129120
*,
130121
fold: int = ...,
131122
) -> datetime: ...
132-
if sys.version_info >= (3, 8):
133-
def astimezone(self: _S, tz: _tzinfo | None = ...) -> _S: ...
134-
else:
135-
def astimezone(self, tz: _tzinfo | None = ...) -> datetime: ...
123+
def astimezone(self: _S, tz: _tzinfo | None = ...) -> _S: ...
136124
def ctime(self) -> str: ...
137125
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
138126
@classmethod
@@ -144,12 +132,8 @@ class Timestamp(datetime):
144132
def __lt__(self, other: datetime) -> bool: ... # type: ignore
145133
def __ge__(self, other: datetime) -> bool: ... # type: ignore
146134
def __gt__(self, other: datetime) -> bool: ... # type: ignore
147-
if sys.version_info >= (3, 8):
148-
def __add__(self: _S, other: timedelta) -> _S: ...
149-
def __radd__(self: _S, other: timedelta) -> _S: ...
150-
else:
151-
def __add__(self, other: timedelta) -> datetime: ...
152-
def __radd__(self, other: timedelta) -> datetime: ...
135+
def __add__(self: _S, other: timedelta) -> _S: ...
136+
def __radd__(self: _S, other: timedelta) -> _S: ...
153137
@overload # type: ignore
154138
def __sub__(self, other: datetime) -> timedelta: ...
155139
@overload

pandas/tests/io/json/test_json_table_schema.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tests for Table Schema integration."""
22
from collections import OrderedDict
33
import json
4-
import sys
54

65
import numpy as np
76
import pytest
@@ -691,7 +690,6 @@ class TestTableOrientReader:
691690
},
692691
],
693692
)
694-
@pytest.mark.skipif(sys.version_info[:3] == (3, 7, 0), reason="GH-35309")
695693
def test_read_json_table_orient(self, index_nm, vals, recwarn):
696694
df = DataFrame(vals, index=pd.Index(range(4), name=index_nm))
697695
out = df.to_json(orient="table")
@@ -741,7 +739,6 @@ def test_read_json_table_orient_raises(self, index_nm, vals, recwarn):
741739
},
742740
],
743741
)
744-
@pytest.mark.skipif(sys.version_info[:3] == (3, 7, 0), reason="GH-35309")
745742
def test_read_json_table_timezones_orient(self, idx, vals, recwarn):
746743
# GH 35973
747744
df = DataFrame(vals, index=idx)

0 commit comments

Comments
 (0)