Skip to content

flake8-pyi's Y027: use collections.abc in pyi files #479

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 1 commit into from
Dec 23, 2022
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- flake8-pyi==22.11.0
types: [pyi]
args: [
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 W503 Y019 Y027 Y034 Y037 Y041 Y042,
--ignore=E301 E302 E305 E402 E501 E701 E704 F401 F811 W503 Y019 Y034 Y037 Y041 Y042,
# TypeVars in private files are already private
--per-file-ignores=_*.pyi:Y001
]
2 changes: 1 addition & 1 deletion pandas-stubs/_config/config.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections.abc import Iterable
from contextlib import ContextDecorator
from typing import (
Any,
Iterable,
Literal,
overload,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/properties.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable
from collections.abc import Callable

class CachedProperty:
def __init__(self, func: Callable) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from collections.abc import Collection
from datetime import (
date,
datetime,
Expand All @@ -6,7 +7,6 @@ from datetime import (
)
from typing import (
Any,
Collection,
Literal,
TypeVar,
overload,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/tslibs/vectorized.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Sequence
from collections.abc import Sequence

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_testing/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections.abc import Generator
from contextlib import contextmanager
from typing import (
Any,
Generator,
Literal,
overload,
)
Expand Down
14 changes: 8 additions & 6 deletions pandas-stubs/_typing.pyi
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
from builtins import type as type_t
import datetime
from os import PathLike
from typing import (
Any,
from collections.abc import (
Callable,
Hashable,
Iterator,
Literal,
Mapping,
MutableSequence,
Sequence,
)
import datetime
from os import PathLike
from typing import (
Any,
Literal,
Optional,
Protocol,
Sequence,
TypedDict,
TypeVar,
Union,
Expand Down
6 changes: 2 additions & 4 deletions pandas-stubs/core/algorithms.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import (
Sequence,
overload,
)
from collections.abc import Sequence
from typing import overload

import numpy as np
from pandas import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/base.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Sequence
from collections.abc import Sequence

import numpy as np

Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/arrays/categorical.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from collections.abc import (
Callable,
Sequence,
)
from typing import (
Any,
Callable,
Literal,
Sequence,
overload,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/datetimelike.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Sequence
from collections.abc import Sequence

import numpy as np
from pandas.core.arrays.base import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/period.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Sequence
from collections.abc import Sequence

import numpy as np
from pandas.core.arrays.datetimelike import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/timedeltas.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Sequence
from datetime import timedelta
from typing import Sequence

from pandas.core.arrays.datetimelike import (
DatetimeLikeArrayMixin,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/common.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import (
from collections.abc import (
Collection,
Iterable,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/computation/eval.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections.abc import Mapping
from typing import (
Any,
Literal,
Mapping,
)

from pandas import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/computation/parsing.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Iterator
import tokenize
from typing import Iterator

BACKTICK_QUOTED_STRING: int

Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/construction.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Sequence
from collections.abc import Sequence

import numpy as np
from pandas.core.indexes.api import Index
Expand Down
16 changes: 9 additions & 7 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import datetime
import datetime as _dt
from typing import (
Any,
from collections.abc import (
Callable,
ClassVar,
Hashable,
Iterable,
Iterator,
Literal,
Mapping,
Pattern,
Sequence,
)
import datetime
import datetime as _dt
from re import Pattern
from typing import (
Any,
ClassVar,
Literal,
TypeVar,
overload,
)
Expand Down
12 changes: 7 additions & 5 deletions pandas-stubs/core/generic.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import sqlite3
from typing import (
Any,
from collections.abc import (
Callable,
ClassVar,
Hashable,
Iterable,
Literal,
Mapping,
Sequence,
)
import sqlite3
from typing import (
Any,
ClassVar,
Literal,
final,
overload,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/groupby/base.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# from pandas.core.dtypes.common import is_list_like as is_list_like, is_scalar as is_scalar
from collections.abc import Hashable
import dataclasses
from typing import Hashable

@dataclasses.dataclass(order=True, frozen=True)
class OutputKey:
Expand Down
10 changes: 6 additions & 4 deletions pandas-stubs/core/groupby/generic.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from typing import (
Any,
from collections.abc import (
Callable,
Generic,
Iterable,
Iterator,
Sequence,
)
from typing import (
Any,
Generic,
Literal,
NamedTuple,
Sequence,
Union,
overload,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/groupby/groupby.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import (
from collections.abc import (
Callable,
Hashable,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/groupby/grouper.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Hashable
from collections.abc import Hashable

import numpy as np
from pandas import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/groupby/ops.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Sequence
from collections.abc import Sequence

import numpy as np
from pandas import (
Expand Down
8 changes: 5 additions & 3 deletions pandas-stubs/core/indexes/base.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from typing import (
from collections.abc import (
Callable,
ClassVar,
Hashable,
Iterable,
Iterator,
Literal,
Sequence,
)
from typing import (
ClassVar,
Literal,
overload,
)

Expand Down
10 changes: 5 additions & 5 deletions pandas-stubs/core/indexes/datetimes.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from collections.abc import (
Hashable,
Sequence,
)
from datetime import (
timedelta,
tzinfo,
)
from typing import (
Hashable,
Sequence,
overload,
)
from typing import overload

import numpy as np
from pandas import (
Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/indexes/interval.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from collections.abc import (
Hashable,
Sequence,
)
import datetime as dt
from typing import (
Generic,
Hashable,
Literal,
Sequence,
Union,
overload,
)
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/indexes/multi.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import (
from collections.abc import (
Callable,
Hashable,
Literal,
Sequence,
)
from typing import Literal

import numpy as np
import pandas as pd
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/numeric.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Iterable
from collections.abc import Iterable

from pandas.core.indexes.base import Index

Expand Down
6 changes: 2 additions & 4 deletions pandas-stubs/core/indexes/period.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import (
Hashable,
overload,
)
from collections.abc import Hashable
from typing import overload

import numpy as np
import pandas as pd
Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/indexes/timedeltas.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from collections.abc import (
Hashable,
Sequence,
)
import datetime as dt
from typing import (
Hashable,
Literal,
Sequence,
overload,
)

Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/interchange/dataframe_protocol.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ from abc import (
ABC,
abstractmethod,
)
from collections.abc import (
Iterable,
Sequence,
)
import enum
from typing import (
Any,
Iterable,
Sequence,
TypedDict,
)

Expand Down
8 changes: 5 additions & 3 deletions pandas-stubs/core/resample.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from typing import (
from collections.abc import (
Callable,
Generator,
Generic,
Hashable,
Literal,
Mapping,
)
from typing import (
Generic,
Literal,
overload,
)

Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/reshape/concat.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import (
from collections.abc import (
Iterable,
Literal,
Mapping,
Sequence,
)
from typing import (
Literal,
overload,
)

Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/reshape/encoding.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import (
from collections.abc import (
Hashable,
Iterable,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/reshape/melt.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Hashable
from collections.abc import Hashable

import numpy as np
from pandas.core.frame import DataFrame
Expand Down
Loading