Skip to content

Commit

Permalink
fix: correct type hint for older versions of Python
Browse files Browse the repository at this point in the history
  • Loading branch information
mamo3gr authored and cosmicBboy committed Dec 31, 2024
1 parent cb5326b commit 1b8e925
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pandera/api/pandas/model.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""Class-based api for pandas models."""

from __future__ import annotations
import copy

from typing import Any, Dict, List, Optional, Self, Tuple, Type, Union
import sys
from typing import Any, Dict, List, Optional, Tuple, Type, Union

import pandas as pd

Expand All @@ -24,6 +23,12 @@
DataFrame,
)

# if python version is < 3.11, import Self from typing_extensions
if sys.version_info < (3, 11):
from typing_extensions import Self
else:
from typing import Self

SchemaIndex = Union[Index, MultiIndex]


Expand Down

0 comments on commit 1b8e925

Please sign in to comment.