We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Nullable pandas BooleanDtype should be exposed as `pandera.typing.BOOL`
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.

Other nullable types are exposed, eg as `P.INT64`, or `P.STRING`. 

`P.BOOL` is missing, even though it is defined.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

`BOOL` is already defined, so it should be aliased in typing/common.py as 

```py 
BOOL = pandas_engine.BOOL
```
and added to `GenericDtype` in the same file, then imported again in `typing/__init__.py` to expose it like other generic types.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

We had been using `P.Series[pd.BooleanDtype]`, but this appears not to be prefered in v0.8.0

**Additional context**
Add any other context or screenshots about the feature request here.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pandera/typing/common.py`
Content:
```
1 """Common typing functionality."""
2 # pylint:disable=abstract-method,disable=too-many-ancestors
3 
4 import inspect
5 from typing import TYPE_CHECKING, Any, Generic, Type, TypeVar
6 
7 import pandas as pd
8 import typing_inspect
9 
10 from .. import dtypes
11 from ..engines import numpy_engine, pandas_engine
12 
13 Bool = dtypes.Bool  #: ``"bool"`` numpy dtype
14 DateTime = dtypes.DateTime  #: ``"datetime64[ns]"`` numpy dtype
15 Timedelta = dtypes.Timedelta  #: ``"timedelta64[ns]"`` numpy dtype
16 Category = dtypes.Category  #: pandas ``"categorical"`` datatype
17 Float = dtypes.Float  #: ``"float"`` numpy dtype
18 Float16 = dtypes.Float16  #: ``"float16"`` numpy dtype
19 Float32 = dtypes.Float32  #: ``"float32"`` numpy dtype
20 Float64 = dtypes.Float64  #: ``"float64"`` numpy dtype
21 Int = dtypes.Int  #: ``"int"`` numpy dtype
22 Int8 = dtypes.Int8  #: ``"int8"`` numpy dtype
23 Int16 = dtypes.Int16  #: ``"int16"`` numpy dtype
24 Int32 = dtypes.Int32  #: ``"int32"`` numpy dtype
25 Int64 = dtypes.Int64  #: ``"int64"`` numpy dtype
26 UInt8 = dtypes.UInt8  #: ``"uint8"`` numpy dtype
27 UInt16 = dtypes.UInt16  #: ``"uint16"`` numpy dtype
28 UInt32 = dtypes.UInt32  #: ``"uint32"`` numpy dtype
29 UInt64 = dtypes.UInt64  #: ``"uint64"`` numpy dtype
30 INT8 = pandas_engine.INT8  #: ``"Int8"`` pandas dtype:: pandas 0.24.0+
31 INT16 = pandas_engine.INT16  #: ``"Int16"`` pandas dtype: pandas 0.24.0+
32 INT32 = pandas_engine.INT32  #: ``"Int32"`` pandas dtype: pandas 0.24.0+
33 INT64 = pandas_engine.INT64  #: ``"Int64"`` pandas dtype: pandas 0.24.0+
34 UINT8 = pandas_engine.UINT8  #: ``"UInt8"`` pandas dtype:: pandas 0.24.0+
35 UINT16 = pandas_engine.UINT16  #: ``"UInt16"`` pandas dtype: pandas 0.24.0+
36 UINT32 = pandas_engine.UINT32  #: ``"UInt32"`` pandas dtype: pandas 0.24.0+
37 UINT64 = pandas_engine.UINT64  #: ``"UInt64"`` pandas dtype: pandas 0.24.0+
38 Object = numpy_engine.Object  #: ``"object"`` numpy dtype
39 String = dtypes.String  #: ``"str"`` numpy dtype
40 #: ``"string"`` pandas dtypes: pandas 1.0.0+. For <1.0.0, this enum will
41 #: fall back on the str-as-object-array representation.
42 STRING = pandas_engine.STRING  #: ``"str"`` numpy dtype
43 
44 GenericDtype = TypeVar(  # type: ignore
45     "GenericDtype",
46     bool,
47     int,
48     str,
49     float,
50     pd.core.dtypes.base.ExtensionDtype,
51     Bool,
52     DateTime,
53     Timedelta,
54     Category,
55     Float,
56     Float16,
57     Float32,
58     Float64,
59     Int,
60     Int8,
61     Int16,
62     Int32,
63     Int64,
64     UInt8,
65     UInt16,
66     UInt32,
67     UInt64,
68     INT8,
69     INT16,
70     INT32,
71     INT64,
72     UINT8,
73     UINT16,
74     UINT32,
75     UINT64,
76     Object,
77     String,
78     STRING,
79     covariant=True,
80 )
81 Schema = TypeVar("Schema", bound="SchemaModel")  # type: ignore
82 
83 
84 # pylint:disable=invalid-name
85 if TYPE_CHECKING:
86     T = TypeVar("T")  # pragma: no cover
87 else:
88     T = Schema
89 
90 
91 class DataFrameBase(Generic[T]):
92     # pylint: disable=too-few-public-methods
93     """
94     Pandera Dataframe base class for validating dataframes on
95     initialization.
96     """
97 
98     def __setattr__(self, name: str, value: Any) -> None:
99         # pylint: disable=no-member
100         object.__setattr__(self, name, value)
101         if name == "__orig_class__":
102             orig_class = getattr(self, "__orig_class__")
103             class_args = getattr(orig_class, "__args__", None)
104             if any(
105                 x.__name__ == "SchemaModel"
106                 for x in inspect.getmro(class_args[0])
107             ):
108                 schema_model = value.__args__[0]
109 
110             # prevent the double validation problem by preventing checks for
111             # dataframes with a defined pandera.schema
112             pandera = getattr(self, "pandera")
113             if (
114                 pandera.schema is None
115                 or pandera.schema != schema_model.to_schema()
116             ):
117                 # pylint: disable=self-cls-assignment
118                 self = schema_model.validate(self)
119                 pandera.add_schema(schema_model.to_schema())
120 
121 
122 # pylint:disable=too-few-public-methods
123 class SeriesBase(Generic[GenericDtype]):
124     """Pandera Series base class to use for all pandas-like APIs."""
125 
126     def __get__(
127         self, instance: object, owner: Type
128     ) -> str:  # pragma: no cover
129         raise AttributeError("Series should resolve to Field-s")
130 
131 
132 # pylint:disable=too-few-public-methods
133 class IndexBase(Generic[GenericDtype]):
134     """Representation of pandas.Index, only used for type annotation.
135 
136     *new in 0.5.0*
137     """
138 
139 
140 class AnnotationInfo:  # pylint:disable=too-few-public-methods
141     """Captures extra information about an annotation.
142 
143     Attributes:
144         origin: The non-parameterized generic class.
145         arg: The first generic type (SchemaModel does not support more than
146             1 argument).
147         literal: Whether the annotation is a literal.
148         optional: Whether the annotation is optional.
149         raw_annotation: The raw annotation.
150         metadata: Extra arguments passed to :data:`typing.Annotated`.
151     """
152 
153     def __init__(self, raw_annotation: Type) -> None:
154         self._parse_annotation(raw_annotation)
155 
156     @property
157     def is_generic_df(self) -> bool:
158         """True if the annotation is a DataFrameBase subclass."""
159         try:
160             if self.origin is None:
161                 return False
162             return issubclass(self.origin, DataFrameBase)
163         except TypeError:
164             return False
165 
166     def _parse_annotation(self, raw_annotation: Type) -> None:
167         """Parse key information from annotation.
168 
169         :param annotation: A subscripted type.
170         :returns: Annotation
171         """
172         self.raw_annotation = raw_annotation
173         self.origin = self.arg = None
174 
175         self.optional = typing_inspect.is_optional_type(raw_annotation)
176         if self.optional and typing_inspect.is_union_type(raw_annotation):
177             # Annotated with Optional or Union[..., NoneType]
178             # get_args -> (pandera.typing.Index[str], <class 'NoneType'>)
179             raw_annotation = typing_inspect.get_args(raw_annotation)[0]
180 
181         self.origin = typing_inspect.get_origin(raw_annotation)
182         # Replace empty tuple returned from get_args by None
183         args = typing_inspect.get_args(raw_annotation) or None
184         self.arg = args[0] if args else args
185 
186         self.metadata = getattr(self.arg, "__metadata__", None)
187         if self.metadata:
188             self.arg = typing_inspect.get_args(self.arg)[0]
189 
190         self.literal = typing_inspect.is_literal_type(self.arg)
191         if self.literal:
192             self.arg = typing_inspect.get_args(self.arg)[0]
193
```

Path: `pandera/typing/__init__.py`
Content:
```
1 """Typing module.
2 
3 For backwards compatibility, pandas types are exposed to the top-level scope of
4 the typing module.
5 """
6 
7 from . import dask, koalas, modin
8 from .common import (
9     INT8,
10     INT16,
11     INT32,
12     INT64,
13     STRING,
14     UINT8,
15     UINT16,
16     UINT32,
17     UINT64,
18     AnnotationInfo,
19     Bool,
20     Category,
21     DateTime,
22     Float,
23     Float16,
24     Float32,
25     Float64,
26     Int,
27     Int8,
28     Int16,
29     Int32,
30     Int64,
31     Object,
32     String,
33     Timedelta,
34     UInt8,
35     UInt16,
36     UInt32,
37     UInt64,
38 )
39 from .pandas import DataFrame, Index, Series
40 
41 DATAFRAME_TYPES = {DataFrame}
42 SERIES_TYPES = {Series}
43 INDEX_TYPES = {Index}
44 
45 if dask.DASK_INSTALLED:
46     DATAFRAME_TYPES.update({dask.DataFrame})
47     SERIES_TYPES.update({dask.Series})
48     INDEX_TYPES.update({dask.Index})
49 
50 if modin.MODIN_INSTALLED:
51     DATAFRAME_TYPES.update({modin.DataFrame})
52     SERIES_TYPES.update({modin.Series})
53     INDEX_TYPES.update({modin.Index})
54 
55 if koalas.KOALAS_INSTALLED:
56     DATAFRAME_TYPES.update({koalas.DataFrame})
57     SERIES_TYPES.update({koalas.Series})
58     INDEX_TYPES.update({koalas.Index})
59
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pandera/typing/__init__.py b/pandera/typing/__init__.py
--- a/pandera/typing/__init__.py
+++ b/pandera/typing/__init__.py
@@ -6,6 +6,7 @@
 
 from . import dask, koalas, modin
 from .common import (
+    BOOL,
     INT8,
     INT16,
     INT32,
diff --git a/pandera/typing/common.py b/pandera/typing/common.py
--- a/pandera/typing/common.py
+++ b/pandera/typing/common.py
@@ -40,6 +40,7 @@
 #: ``"string"`` pandas dtypes: pandas 1.0.0+. For <1.0.0, this enum will
 #: fall back on the str-as-object-array representation.
 STRING = pandas_engine.STRING  #: ``"str"`` numpy dtype
+BOOL = pandas_engine.BOOL  #: ``"str"`` numpy dtype
 
 GenericDtype = TypeVar(  # type: ignore
     "GenericDtype",
@@ -76,6 +77,7 @@
     Object,
     String,
     STRING,
+    BOOL,
     covariant=True,
 )
 Schema = TypeVar("Schema", bound="SchemaModel")  # type: ignore

{"golden_diff": "diff --git a/pandera/typing/__init__.py b/pandera/typing/__init__.py\n--- a/pandera/typing/__init__.py\n+++ b/pandera/typing/__init__.py\n@@ -6,6 +6,7 @@\n \n from . import dask, koalas, modin\n from .common import (\n+    BOOL,\n     INT8,\n     INT16,\n     INT32,\ndiff --git a/pandera/typing/common.py b/pandera/typing/common.py\n--- a/pandera/typing/common.py\n+++ b/pandera/typing/common.py\n@@ -40,6 +40,7 @@\n #: ``\"string\"`` pandas dtypes: pandas 1.0.0+. For <1.0.0, this enum will\n #: fall back on the str-as-object-array representation.\n STRING = pandas_engine.STRING  #: ``\"str\"`` numpy dtype\n+BOOL = pandas_engine.BOOL  #: ``\"str\"`` numpy dtype\n \n GenericDtype = TypeVar(  # type: ignore\n     \"GenericDtype\",\n@@ -76,6 +77,7 @@\n     Object,\n     String,\n     STRING,\n+    BOOL,\n     covariant=True,\n )\n Schema = TypeVar(\"Schema\", bound=\"SchemaModel\")  # type: ignore\n", "issue": "Nullable pandas BooleanDtype should be exposed as `pandera.typing.BOOL`\n**Is your feature request related to a problem? Please describe.**\r\nA clear and concise description of what the problem is.\r\n\r\nOther nullable types are exposed, eg as `P.INT64`, or `P.STRING`. \r\n\r\n`P.BOOL` is missing, even though it is defined.\r\n\r\n**Describe the solution you'd like**\r\nA clear and concise description of what you want to happen.\r\n\r\n`BOOL` is already defined, so it should be aliased in typing/common.py as \r\n\r\n```py \r\nBOOL = pandas_engine.BOOL\r\n```\r\nand added to `GenericDtype` in the same file, then imported again in `typing/__init__.py` to expose it like other generic types.\r\n\r\n**Describe alternatives you've considered**\r\nA clear and concise description of any alternative solutions or features you've considered.\r\n\r\nWe had been using `P.Series[pd.BooleanDtype]`, but this appears not to be prefered in v0.8.0\r\n\r\n**Additional context**\r\nAdd any other context or screenshots about the feature request here.\r\n\n", "before_files": [{"content": "\"\"\"Common typing functionality.\"\"\"\n# pylint:disable=abstract-method,disable=too-many-ancestors\n\nimport inspect\nfrom typing import TYPE_CHECKING, Any, Generic, Type, TypeVar\n\nimport pandas as pd\nimport typing_inspect\n\nfrom .. import dtypes\nfrom ..engines import numpy_engine, pandas_engine\n\nBool = dtypes.Bool  #: ``\"bool\"`` numpy dtype\nDateTime = dtypes.DateTime  #: ``\"datetime64[ns]\"`` numpy dtype\nTimedelta = dtypes.Timedelta  #: ``\"timedelta64[ns]\"`` numpy dtype\nCategory = dtypes.Category  #: pandas ``\"categorical\"`` datatype\nFloat = dtypes.Float  #: ``\"float\"`` numpy dtype\nFloat16 = dtypes.Float16  #: ``\"float16\"`` numpy dtype\nFloat32 = dtypes.Float32  #: ``\"float32\"`` numpy dtype\nFloat64 = dtypes.Float64  #: ``\"float64\"`` numpy dtype\nInt = dtypes.Int  #: ``\"int\"`` numpy dtype\nInt8 = dtypes.Int8  #: ``\"int8\"`` numpy dtype\nInt16 = dtypes.Int16  #: ``\"int16\"`` numpy dtype\nInt32 = dtypes.Int32  #: ``\"int32\"`` numpy dtype\nInt64 = dtypes.Int64  #: ``\"int64\"`` numpy dtype\nUInt8 = dtypes.UInt8  #: ``\"uint8\"`` numpy dtype\nUInt16 = dtypes.UInt16  #: ``\"uint16\"`` numpy dtype\nUInt32 = dtypes.UInt32  #: ``\"uint32\"`` numpy dtype\nUInt64 = dtypes.UInt64  #: ``\"uint64\"`` numpy dtype\nINT8 = pandas_engine.INT8  #: ``\"Int8\"`` pandas dtype:: pandas 0.24.0+\nINT16 = pandas_engine.INT16  #: ``\"Int16\"`` pandas dtype: pandas 0.24.0+\nINT32 = pandas_engine.INT32  #: ``\"Int32\"`` pandas dtype: pandas 0.24.0+\nINT64 = pandas_engine.INT64  #: ``\"Int64\"`` pandas dtype: pandas 0.24.0+\nUINT8 = pandas_engine.UINT8  #: ``\"UInt8\"`` pandas dtype:: pandas 0.24.0+\nUINT16 = pandas_engine.UINT16  #: ``\"UInt16\"`` pandas dtype: pandas 0.24.0+\nUINT32 = pandas_engine.UINT32  #: ``\"UInt32\"`` pandas dtype: pandas 0.24.0+\nUINT64 = pandas_engine.UINT64  #: ``\"UInt64\"`` pandas dtype: pandas 0.24.0+\nObject = numpy_engine.Object  #: ``\"object\"`` numpy dtype\nString = dtypes.String  #: ``\"str\"`` numpy dtype\n#: ``\"string\"`` pandas dtypes: pandas 1.0.0+. For <1.0.0, this enum will\n#: fall back on the str-as-object-array representation.\nSTRING = pandas_engine.STRING  #: ``\"str\"`` numpy dtype\n\nGenericDtype = TypeVar(  # type: ignore\n    \"GenericDtype\",\n    bool,\n    int,\n    str,\n    float,\n    pd.core.dtypes.base.ExtensionDtype,\n    Bool,\n    DateTime,\n    Timedelta,\n    Category,\n    Float,\n    Float16,\n    Float32,\n    Float64,\n    Int,\n    Int8,\n    Int16,\n    Int32,\n    Int64,\n    UInt8,\n    UInt16,\n    UInt32,\n    UInt64,\n    INT8,\n    INT16,\n    INT32,\n    INT64,\n    UINT8,\n    UINT16,\n    UINT32,\n    UINT64,\n    Object,\n    String,\n    STRING,\n    covariant=True,\n)\nSchema = TypeVar(\"Schema\", bound=\"SchemaModel\")  # type: ignore\n\n\n# pylint:disable=invalid-name\nif TYPE_CHECKING:\n    T = TypeVar(\"T\")  # pragma: no cover\nelse:\n    T = Schema\n\n\nclass DataFrameBase(Generic[T]):\n    # pylint: disable=too-few-public-methods\n    \"\"\"\n    Pandera Dataframe base class for validating dataframes on\n    initialization.\n    \"\"\"\n\n    def __setattr__(self, name: str, value: Any) -> None:\n        # pylint: disable=no-member\n        object.__setattr__(self, name, value)\n        if name == \"__orig_class__\":\n            orig_class = getattr(self, \"__orig_class__\")\n            class_args = getattr(orig_class, \"__args__\", None)\n            if any(\n                x.__name__ == \"SchemaModel\"\n                for x in inspect.getmro(class_args[0])\n            ):\n                schema_model = value.__args__[0]\n\n            # prevent the double validation problem by preventing checks for\n            # dataframes with a defined pandera.schema\n            pandera = getattr(self, \"pandera\")\n            if (\n                pandera.schema is None\n                or pandera.schema != schema_model.to_schema()\n            ):\n                # pylint: disable=self-cls-assignment\n                self = schema_model.validate(self)\n                pandera.add_schema(schema_model.to_schema())\n\n\n# pylint:disable=too-few-public-methods\nclass SeriesBase(Generic[GenericDtype]):\n    \"\"\"Pandera Series base class to use for all pandas-like APIs.\"\"\"\n\n    def __get__(\n        self, instance: object, owner: Type\n    ) -> str:  # pragma: no cover\n        raise AttributeError(\"Series should resolve to Field-s\")\n\n\n# pylint:disable=too-few-public-methods\nclass IndexBase(Generic[GenericDtype]):\n    \"\"\"Representation of pandas.Index, only used for type annotation.\n\n    *new in 0.5.0*\n    \"\"\"\n\n\nclass AnnotationInfo:  # pylint:disable=too-few-public-methods\n    \"\"\"Captures extra information about an annotation.\n\n    Attributes:\n        origin: The non-parameterized generic class.\n        arg: The first generic type (SchemaModel does not support more than\n            1 argument).\n        literal: Whether the annotation is a literal.\n        optional: Whether the annotation is optional.\n        raw_annotation: The raw annotation.\n        metadata: Extra arguments passed to :data:`typing.Annotated`.\n    \"\"\"\n\n    def __init__(self, raw_annotation: Type) -> None:\n        self._parse_annotation(raw_annotation)\n\n    @property\n    def is_generic_df(self) -> bool:\n        \"\"\"True if the annotation is a DataFrameBase subclass.\"\"\"\n        try:\n            if self.origin is None:\n                return False\n            return issubclass(self.origin, DataFrameBase)\n        except TypeError:\n            return False\n\n    def _parse_annotation(self, raw_annotation: Type) -> None:\n        \"\"\"Parse key information from annotation.\n\n        :param annotation: A subscripted type.\n        :returns: Annotation\n        \"\"\"\n        self.raw_annotation = raw_annotation\n        self.origin = self.arg = None\n\n        self.optional = typing_inspect.is_optional_type(raw_annotation)\n        if self.optional and typing_inspect.is_union_type(raw_annotation):\n            # Annotated with Optional or Union[..., NoneType]\n            # get_args -> (pandera.typing.Index[str], <class 'NoneType'>)\n            raw_annotation = typing_inspect.get_args(raw_annotation)[0]\n\n        self.origin = typing_inspect.get_origin(raw_annotation)\n        # Replace empty tuple returned from get_args by None\n        args = typing_inspect.get_args(raw_annotation) or None\n        self.arg = args[0] if args else args\n\n        self.metadata = getattr(self.arg, \"__metadata__\", None)\n        if self.metadata:\n            self.arg = typing_inspect.get_args(self.arg)[0]\n\n        self.literal = typing_inspect.is_literal_type(self.arg)\n        if self.literal:\n            self.arg = typing_inspect.get_args(self.arg)[0]\n", "path": "pandera/typing/common.py"}, {"content": "\"\"\"Typing module.\n\nFor backwards compatibility, pandas types are exposed to the top-level scope of\nthe typing module.\n\"\"\"\n\nfrom . import dask, koalas, modin\nfrom .common import (\n    INT8,\n    INT16,\n    INT32,\n    INT64,\n    STRING,\n    UINT8,\n    UINT16,\n    UINT32,\n    UINT64,\n    AnnotationInfo,\n    Bool,\n    Category,\n    DateTime,\n    Float,\n    Float16,\n    Float32,\n    Float64,\n    Int,\n    Int8,\n    Int16,\n    Int32,\n    Int64,\n    Object,\n    String,\n    Timedelta,\n    UInt8,\n    UInt16,\n    UInt32,\n    UInt64,\n)\nfrom .pandas import DataFrame, Index, Series\n\nDATAFRAME_TYPES = {DataFrame}\nSERIES_TYPES = {Series}\nINDEX_TYPES = {Index}\n\nif dask.DASK_INSTALLED:\n    DATAFRAME_TYPES.update({dask.DataFrame})\n    SERIES_TYPES.update({dask.Series})\n    INDEX_TYPES.update({dask.Index})\n\nif modin.MODIN_INSTALLED:\n    DATAFRAME_TYPES.update({modin.DataFrame})\n    SERIES_TYPES.update({modin.Series})\n    INDEX_TYPES.update({modin.Index})\n\nif koalas.KOALAS_INSTALLED:\n    DATAFRAME_TYPES.update({koalas.DataFrame})\n    SERIES_TYPES.update({koalas.Series})\n    INDEX_TYPES.update({koalas.Index})\n", "path": "pandera/typing/__init__.py"}], "after_files": [{"content": "\"\"\"Common typing functionality.\"\"\"\n# pylint:disable=abstract-method,disable=too-many-ancestors\n\nimport inspect\nfrom typing import TYPE_CHECKING, Any, Generic, Type, TypeVar\n\nimport pandas as pd\nimport typing_inspect\n\nfrom .. import dtypes\nfrom ..engines import numpy_engine, pandas_engine\n\nBool = dtypes.Bool  #: ``\"bool\"`` numpy dtype\nDateTime = dtypes.DateTime  #: ``\"datetime64[ns]\"`` numpy dtype\nTimedelta = dtypes.Timedelta  #: ``\"timedelta64[ns]\"`` numpy dtype\nCategory = dtypes.Category  #: pandas ``\"categorical\"`` datatype\nFloat = dtypes.Float  #: ``\"float\"`` numpy dtype\nFloat16 = dtypes.Float16  #: ``\"float16\"`` numpy dtype\nFloat32 = dtypes.Float32  #: ``\"float32\"`` numpy dtype\nFloat64 = dtypes.Float64  #: ``\"float64\"`` numpy dtype\nInt = dtypes.Int  #: ``\"int\"`` numpy dtype\nInt8 = dtypes.Int8  #: ``\"int8\"`` numpy dtype\nInt16 = dtypes.Int16  #: ``\"int16\"`` numpy dtype\nInt32 = dtypes.Int32  #: ``\"int32\"`` numpy dtype\nInt64 = dtypes.Int64  #: ``\"int64\"`` numpy dtype\nUInt8 = dtypes.UInt8  #: ``\"uint8\"`` numpy dtype\nUInt16 = dtypes.UInt16  #: ``\"uint16\"`` numpy dtype\nUInt32 = dtypes.UInt32  #: ``\"uint32\"`` numpy dtype\nUInt64 = dtypes.UInt64  #: ``\"uint64\"`` numpy dtype\nINT8 = pandas_engine.INT8  #: ``\"Int8\"`` pandas dtype:: pandas 0.24.0+\nINT16 = pandas_engine.INT16  #: ``\"Int16\"`` pandas dtype: pandas 0.24.0+\nINT32 = pandas_engine.INT32  #: ``\"Int32\"`` pandas dtype: pandas 0.24.0+\nINT64 = pandas_engine.INT64  #: ``\"Int64\"`` pandas dtype: pandas 0.24.0+\nUINT8 = pandas_engine.UINT8  #: ``\"UInt8\"`` pandas dtype:: pandas 0.24.0+\nUINT16 = pandas_engine.UINT16  #: ``\"UInt16\"`` pandas dtype: pandas 0.24.0+\nUINT32 = pandas_engine.UINT32  #: ``\"UInt32\"`` pandas dtype: pandas 0.24.0+\nUINT64 = pandas_engine.UINT64  #: ``\"UInt64\"`` pandas dtype: pandas 0.24.0+\nObject = numpy_engine.Object  #: ``\"object\"`` numpy dtype\nString = dtypes.String  #: ``\"str\"`` numpy dtype\n#: ``\"string\"`` pandas dtypes: pandas 1.0.0+. For <1.0.0, this enum will\n#: fall back on the str-as-object-array representation.\nSTRING = pandas_engine.STRING  #: ``\"str\"`` numpy dtype\nBOOL = pandas_engine.BOOL  #: ``\"str\"`` numpy dtype\n\nGenericDtype = TypeVar(  # type: ignore\n    \"GenericDtype\",\n    bool,\n    int,\n    str,\n    float,\n    pd.core.dtypes.base.ExtensionDtype,\n    Bool,\n    DateTime,\n    Timedelta,\n    Category,\n    Float,\n    Float16,\n    Float32,\n    Float64,\n    Int,\n    Int8,\n    Int16,\n    Int32,\n    Int64,\n    UInt8,\n    UInt16,\n    UInt32,\n    UInt64,\n    INT8,\n    INT16,\n    INT32,\n    INT64,\n    UINT8,\n    UINT16,\n    UINT32,\n    UINT64,\n    Object,\n    String,\n    STRING,\n    BOOL,\n    covariant=True,\n)\nSchema = TypeVar(\"Schema\", bound=\"SchemaModel\")  # type: ignore\n\n\n# pylint:disable=invalid-name\nif TYPE_CHECKING:\n    T = TypeVar(\"T\")  # pragma: no cover\nelse:\n    T = Schema\n\n\nclass DataFrameBase(Generic[T]):\n    # pylint: disable=too-few-public-methods\n    \"\"\"\n    Pandera Dataframe base class for validating dataframes on\n    initialization.\n    \"\"\"\n\n    def __setattr__(self, name: str, value: Any) -> None:\n        # pylint: disable=no-member\n        object.__setattr__(self, name, value)\n        if name == \"__orig_class__\":\n            orig_class = getattr(self, \"__orig_class__\")\n            class_args = getattr(orig_class, \"__args__\", None)\n            if any(\n                x.__name__ == \"SchemaModel\"\n                for x in inspect.getmro(class_args[0])\n            ):\n                schema_model = value.__args__[0]\n\n            # prevent the double validation problem by preventing checks for\n            # dataframes with a defined pandera.schema\n            pandera = getattr(self, \"pandera\")\n            if (\n                pandera.schema is None\n                or pandera.schema != schema_model.to_schema()\n            ):\n                # pylint: disable=self-cls-assignment\n                self = schema_model.validate(self)\n                pandera.add_schema(schema_model.to_schema())\n\n\n# pylint:disable=too-few-public-methods\nclass SeriesBase(Generic[GenericDtype]):\n    \"\"\"Pandera Series base class to use for all pandas-like APIs.\"\"\"\n\n    def __get__(\n        self, instance: object, owner: Type\n    ) -> str:  # pragma: no cover\n        raise AttributeError(\"Series should resolve to Field-s\")\n\n\n# pylint:disable=too-few-public-methods\nclass IndexBase(Generic[GenericDtype]):\n    \"\"\"Representation of pandas.Index, only used for type annotation.\n\n    *new in 0.5.0*\n    \"\"\"\n\n\nclass AnnotationInfo:  # pylint:disable=too-few-public-methods\n    \"\"\"Captures extra information about an annotation.\n\n    Attributes:\n        origin: The non-parameterized generic class.\n        arg: The first generic type (SchemaModel does not support more than\n            1 argument).\n        literal: Whether the annotation is a literal.\n        optional: Whether the annotation is optional.\n        raw_annotation: The raw annotation.\n        metadata: Extra arguments passed to :data:`typing.Annotated`.\n    \"\"\"\n\n    def __init__(self, raw_annotation: Type) -> None:\n        self._parse_annotation(raw_annotation)\n\n    @property\n    def is_generic_df(self) -> bool:\n        \"\"\"True if the annotation is a DataFrameBase subclass.\"\"\"\n        try:\n            if self.origin is None:\n                return False\n            return issubclass(self.origin, DataFrameBase)\n        except TypeError:\n            return False\n\n    def _parse_annotation(self, raw_annotation: Type) -> None:\n        \"\"\"Parse key information from annotation.\n\n        :param annotation: A subscripted type.\n        :returns: Annotation\n        \"\"\"\n        self.raw_annotation = raw_annotation\n        self.origin = self.arg = None\n\n        self.optional = typing_inspect.is_optional_type(raw_annotation)\n        if self.optional and typing_inspect.is_union_type(raw_annotation):\n            # Annotated with Optional or Union[..., NoneType]\n            # get_args -> (pandera.typing.Index[str], <class 'NoneType'>)\n            raw_annotation = typing_inspect.get_args(raw_annotation)[0]\n\n        self.origin = typing_inspect.get_origin(raw_annotation)\n        # Replace empty tuple returned from get_args by None\n        args = typing_inspect.get_args(raw_annotation) or None\n        self.arg = args[0] if args else args\n\n        self.metadata = getattr(self.arg, \"__metadata__\", None)\n        if self.metadata:\n            self.arg = typing_inspect.get_args(self.arg)[0]\n\n        self.literal = typing_inspect.is_literal_type(self.arg)\n        if self.literal:\n            self.arg = typing_inspect.get_args(self.arg)[0]\n", "path": "pandera/typing/common.py"}, {"content": "\"\"\"Typing module.\n\nFor backwards compatibility, pandas types are exposed to the top-level scope of\nthe typing module.\n\"\"\"\n\nfrom . import dask, koalas, modin\nfrom .common import (\n    BOOL,\n    INT8,\n    INT16,\n    INT32,\n    INT64,\n    STRING,\n    UINT8,\n    UINT16,\n    UINT32,\n    UINT64,\n    AnnotationInfo,\n    Bool,\n    Category,\n    DateTime,\n    Float,\n    Float16,\n    Float32,\n    Float64,\n    Int,\n    Int8,\n    Int16,\n    Int32,\n    Int64,\n    Object,\n    String,\n    Timedelta,\n    UInt8,\n    UInt16,\n    UInt32,\n    UInt64,\n)\nfrom .pandas import DataFrame, Index, Series\n\nDATAFRAME_TYPES = {DataFrame}\nSERIES_TYPES = {Series}\nINDEX_TYPES = {Index}\n\nif dask.DASK_INSTALLED:\n    DATAFRAME_TYPES.update({dask.DataFrame})\n    SERIES_TYPES.update({dask.Series})\n    INDEX_TYPES.update({dask.Index})\n\nif modin.MODIN_INSTALLED:\n    DATAFRAME_TYPES.update({modin.DataFrame})\n    SERIES_TYPES.update({modin.Series})\n    INDEX_TYPES.update({modin.Index})\n\nif koalas.KOALAS_INSTALLED:\n    DATAFRAME_TYPES.update({koalas.DataFrame})\n    SERIES_TYPES.update({koalas.Series})\n    INDEX_TYPES.update({koalas.Index})\n", "path": "pandera/typing/__init__.py"}]}