From 8d57dd5c717e61e827f25b1f30637185654f59df Mon Sep 17 00:00:00 2001 From: Cristian Matache Date: Thu, 8 Jul 2021 22:16:55 +0100 Subject: [PATCH] added py.typed and typed Series descriptor (#543) --- pandera/py.typed | 0 pandera/typing.py | 3 +++ setup.py | 1 + 3 files changed, 4 insertions(+) create mode 100644 pandera/py.typed diff --git a/pandera/py.typed b/pandera/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/pandera/typing.py b/pandera/typing.py index 86328149e..8df9d2a86 100644 --- a/pandera/typing.py +++ b/pandera/typing.py @@ -72,6 +72,9 @@ class Series(pd.Series, Generic[GenericDtype]): # type: ignore *new in 0.5.0* """ + def __get__(self, instance: object, owner: Type) -> str: + raise AttributeError("Series should resolve to Field-s") + if TYPE_CHECKING: # pragma: no cover # pylint:disable=too-few-public-methods,invalid-name diff --git a/setup.py b/setup.py index f61101613..01f9bd39e 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,7 @@ license="MIT", data_files=[("", ["LICENSE.txt"])], packages=["pandera"], + package_data={"pandera": ["py.typed"]}, install_requires=[ "packaging >= 20.0", "numpy >= 1.9.0",