Skip to content

Commit

Permalink
CLN: remove checks for python < 3.8 (#44223)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoertwein authored Oct 29, 2021
1 parent 66ce5de commit b2055b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
26 changes: 5 additions & 21 deletions pandas/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ from datetime import (
timedelta,
tzinfo as _tzinfo,
)
import sys
from time import struct_time
from typing import (
ClassVar,
Expand Down Expand Up @@ -89,16 +88,8 @@ class Timestamp(datetime):
def today(cls: Type[_S]) -> _S: ...
@classmethod
def fromordinal(cls: Type[_S], n: int) -> _S: ...
if sys.version_info >= (3, 8):
@classmethod
def now(cls: Type[_S], tz: _tzinfo | str | None = ...) -> _S: ...
else:
@overload
@classmethod
def now(cls: Type[_S], tz: None = ...) -> _S: ...
@overload
@classmethod
def now(cls, tz: _tzinfo) -> datetime: ...
@classmethod
def now(cls: Type[_S], tz: _tzinfo | str | None = ...) -> _S: ...
@classmethod
def utcnow(cls: Type[_S]) -> _S: ...
@classmethod
Expand Down Expand Up @@ -129,10 +120,7 @@ class Timestamp(datetime):
*,
fold: int = ...,
) -> datetime: ...
if sys.version_info >= (3, 8):
def astimezone(self: _S, tz: _tzinfo | None = ...) -> _S: ...
else:
def astimezone(self, tz: _tzinfo | None = ...) -> datetime: ...
def astimezone(self: _S, tz: _tzinfo | None = ...) -> _S: ...
def ctime(self) -> str: ...
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
@classmethod
Expand All @@ -144,12 +132,8 @@ class Timestamp(datetime):
def __lt__(self, other: datetime) -> bool: ... # type: ignore
def __ge__(self, other: datetime) -> bool: ... # type: ignore
def __gt__(self, other: datetime) -> bool: ... # type: ignore
if sys.version_info >= (3, 8):
def __add__(self: _S, other: timedelta) -> _S: ...
def __radd__(self: _S, other: timedelta) -> _S: ...
else:
def __add__(self, other: timedelta) -> datetime: ...
def __radd__(self, other: timedelta) -> datetime: ...
def __add__(self: _S, other: timedelta) -> _S: ...
def __radd__(self: _S, other: timedelta) -> _S: ...
@overload # type: ignore
def __sub__(self, other: datetime) -> timedelta: ...
@overload
Expand Down
3 changes: 0 additions & 3 deletions pandas/tests/io/json/test_json_table_schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for Table Schema integration."""
from collections import OrderedDict
import json
import sys

import numpy as np
import pytest
Expand Down Expand Up @@ -691,7 +690,6 @@ class TestTableOrientReader:
},
],
)
@pytest.mark.skipif(sys.version_info[:3] == (3, 7, 0), reason="GH-35309")
def test_read_json_table_orient(self, index_nm, vals, recwarn):
df = DataFrame(vals, index=pd.Index(range(4), name=index_nm))
out = df.to_json(orient="table")
Expand Down Expand Up @@ -741,7 +739,6 @@ def test_read_json_table_orient_raises(self, index_nm, vals, recwarn):
},
],
)
@pytest.mark.skipif(sys.version_info[:3] == (3, 7, 0), reason="GH-35309")
def test_read_json_table_timezones_orient(self, idx, vals, recwarn):
# GH 35973
df = DataFrame(vals, index=idx)
Expand Down

0 comments on commit b2055b1

Please sign in to comment.