mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-09 06:46:18 +08:00
[seaborn] Unpin pandas-stubs (#15135)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
version = "0.13.2"
|
||||
# Requires a version of numpy and matplotlib with a `py.typed` file
|
||||
requires = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs<2.3.3.251201"]
|
||||
requires = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs"]
|
||||
upstream_repository = "https://github.com/mwaskom/seaborn"
|
||||
|
||||
@@ -3,8 +3,7 @@ from collections.abc import Mapping
|
||||
from typing import TypeVar, overload
|
||||
|
||||
from pandas import DataFrame
|
||||
from pandas.core.interchange.dataframe_protocol import DataFrame as DataFrameProtocol
|
||||
from seaborn._core.typing import DataSource, VariableSpec
|
||||
from seaborn._core.typing import DataSource, SupportsDataFrame, VariableSpec
|
||||
|
||||
_T = TypeVar("_T", Mapping[Incomplete, Incomplete], None)
|
||||
|
||||
@@ -22,5 +21,5 @@ class PlotData:
|
||||
@overload
|
||||
def handle_data_source(data: _T) -> _T: ...
|
||||
@overload
|
||||
def handle_data_source(data: DataFrameProtocol) -> DataFrame: ...
|
||||
def handle_data_source(data: SupportsDataFrame) -> DataFrame: ...
|
||||
def convert_dataframe_to_pandas(data: object) -> DataFrame: ...
|
||||
|
||||
@@ -10,8 +10,6 @@ from pandas import DataFrame, Index, Series, Timedelta, Timestamp
|
||||
|
||||
@type_check_only
|
||||
class SupportsDataFrame(Protocol):
|
||||
# `__dataframe__` should return pandas.core.interchange.dataframe_protocol.DataFrame
|
||||
# but this class needs to be defined as a Protocol, not as an ABC.
|
||||
def __dataframe__(self, nan_as_null: bool = ..., allow_copy: bool = ...): ...
|
||||
|
||||
ColumnName: TypeAlias = str | bytes | date | datetime | timedelta | bool | complex | Timestamp | Timedelta
|
||||
|
||||
Reference in New Issue
Block a user