From 6fbaa995baa788011f4087e9524aa861efb0b418 Mon Sep 17 00:00:00 2001 From: Jonas Hoersch Date: Wed, 23 Oct 2024 09:54:01 +0200 Subject: [PATCH] fix: python 3.9 regression from typing --- src/pandas_indexing/accessors.py | 4 ++-- src/pandas_indexing/core.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pandas_indexing/accessors.py b/src/pandas_indexing/accessors.py index bebff5c..393ebd5 100644 --- a/src/pandas_indexing/accessors.py +++ b/src/pandas_indexing/accessors.py @@ -80,7 +80,7 @@ def extract( regex: bool = False, axis: Axis = 0, drop: Optional[bool] = None, - optional: Sequence[str] | None = None, + optional: Optional[Sequence[str]] = None, **templates: str, ) -> Union[DataFrame, Series, Index]: if drop is not None: @@ -102,7 +102,7 @@ def extract( @doc(formatlevel, index_or_data="") def format( - self, axis: Axis = 0, optional: Sequence[str] | None = None, **templates: str + self, axis: Axis = 0, optional: Optional[Sequence[str]] = None, **templates: str ) -> Union[DataFrame, Series, Index]: return formatlevel(self._obj, axis=axis, optional=optional, **templates) diff --git a/src/pandas_indexing/core.py b/src/pandas_indexing/core.py index d76868e..707925c 100644 --- a/src/pandas_indexing/core.py +++ b/src/pandas_indexing/core.py @@ -753,7 +753,7 @@ def extractlevel( regex: bool = False, drop: Optional[bool] = None, axis: Axis = 0, - optional: Sequence[str] | None = None, + optional: Optional[Sequence[str]] = None, **templates: str, ) -> T: """Extract new index levels with *templates* matched against any index @@ -970,7 +970,7 @@ def formatlevel( index_or_data: T, drop: bool = False, axis: Axis = 0, - optional: Sequence[str] | None = None, + optional: Optional[Sequence[str]] = None, **templates: str, ) -> T: """Format index levels based on a *template* which can refer to other