Skip to content

Pandas 2.1 requires python>3.9 #768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ repos:
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.285
rev: v0.0.286
hooks:
- id: ruff
args: [
--exit-non-zero-on-fix,
--target-version, py38,
--target-version, py39,
--extend-select, "PYI,UP,RUF100",
--ignore, "E501,E731,F841,PYI042",
--per-file-ignores, "_*.pyi:PYI001",
Expand Down
7 changes: 1 addition & 6 deletions pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from datetime import (
_IsoCalendarDate,
date as _date,
datetime,
time as _time,
timedelta,
tzinfo as _tzinfo,
)
import sys
from time import struct_time
from typing import (
ClassVar,
Expand Down Expand Up @@ -46,11 +46,6 @@ _Nonexistent: TypeAlias = (
Literal["raise", "NaT", "shift_backward", "shift_forward"] | Timedelta | timedelta
)

if sys.version_info >= (3, 9):
from datetime import _IsoCalendarDate
else:
_IsoCalendarDate: TypeAlias = tuple[int, int, int]

class Timestamp(datetime):
min: ClassVar[Timestamp]
max: ClassVar[Timestamp]
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/base.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Iterator
from typing import (
Generic,
Iterator,
Literal,
)

Expand Down
10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -31,12 +30,9 @@ packages = [
"Documentation" = "https://pandas.pydata.org/pandas-docs/stable"

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
types-pytz = ">= 2022.1.1"
numpy = [
{version = "<=1.24.3", python = "<=3.8"},
{version = ">=1.25.0", python = ">=3.9"}
]
numpy = ">=1.25.0"

[tool.poetry.dev-dependencies]
mypy = "1.5.1"
Expand Down Expand Up @@ -116,7 +112,7 @@ args = [{ name = "allowlist", positional = true, default = "", required = false,


[tool.black]
target-version = ['py38']
target-version = ['py39']

[tool.isort]
known_pre_libs = "pandas._config"
Expand Down
9 changes: 4 additions & 5 deletions scripts/_job.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from collections import deque
from dataclasses import dataclass
import sys
import time
from typing import (
Callable,
Deque,
List,
Optional,
)

Expand All @@ -18,7 +17,7 @@ class Step:
rollback: Optional[Callable[[], None]] = None


def __rollback_job(steps: Deque[Step]):
def __rollback_job(steps: deque[Step]):
"""
Responsible to run rollback of steps.
"""
Expand All @@ -35,12 +34,12 @@ def __rollback_job(steps: Deque[Step]):
)


def run_job(steps: List[Step]) -> None:
def run_job(steps: list[Step]) -> None:
"""
Responsible to run steps with logs.
"""

rollback_steps = Deque[Step]()
rollback_steps = deque[Step]()
failed = False

for step in steps:
Expand Down
4 changes: 1 addition & 3 deletions tests/test_api_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Type

import numpy as np
import pandas as pd
from pandas.api.extensions import ExtensionDtype
Expand Down Expand Up @@ -468,7 +466,7 @@ def test_union_categoricals() -> None:

def test_check_extension_dtypes() -> None:
# GH 315
def check_ext_dtype(etype: Type[ExtensionDtype]):
def check_ext_dtype(etype: type[ExtensionDtype]):
assert issubclass(etype, ExtensionDtype)

check_ext_dtype(pd.Int64Dtype)
Expand Down
10 changes: 6 additions & 4 deletions tests/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
import numpy as np
import pandas as pd
from pandas.api.types import is_any_real_numeric_dtype
from pandas.core.arrays import BooleanArray # noqa: F401
from pandas.core.arrays import IntegerArray # noqa: F401
from pandas.core.arrays import (
BooleanArray,
IntegerArray,
)
import pyarrow as pa
from typing_extensions import assert_type

Expand Down Expand Up @@ -96,7 +98,7 @@ def test_int64_dtype() -> None:
i64dt = pd.Int64Dtype()
check(assert_type(i64dt.itemsize, int), int)
check(assert_type(i64dt.na_value, NAType), NAType)
check(assert_type(i64dt.construct_array_type(), "type[IntegerArray]"), type)
check(assert_type(i64dt.construct_array_type(), type[IntegerArray]), type)


def test_categorical_dtype() -> None:
Expand Down Expand Up @@ -138,7 +140,7 @@ def test_boolean_dtype() -> None:
b_dt = pd.BooleanDtype()
check(assert_type(b_dt, pd.BooleanDtype), pd.BooleanDtype)
check(assert_type(b_dt.na_value, NAType), NAType)
check(assert_type(b_dt.construct_array_type(), "type[BooleanArray]"), type)
check(assert_type(b_dt.construct_array_type(), type[BooleanArray]), type)


def test_arrow_dtype() -> None:
Expand Down
Loading