We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add a polars `Series` type
**Is your feature request related to a problem? Please describe.**
This would provide a similar `pandera.typing.Series` type for the polars API that exists for pandas and other backends. It is not strictly necessary since it does not get checked, but it would be good to have to match the existing API and to help type checkers understand accessing string column names from the class attribute names.

**Describe the solution you'd like**
Allow for annotating polars data frame fields as:
```python
import pandera.polars as pa
from pandera.typing.polars import Series

class MySchema(pa.DataFrameModel):
    a: Series[int]
```


--- 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/api/polars/model.py`
Content:
```
1 """Class-based api for polars models."""
2 
3 from typing import (
4     Dict,
5     List,
6     Tuple,
7     Type,
8 )
9 
10 import pandas as pd
11 import polars as pl
12 from pandera.api.checks import Check
13 from pandera.api.dataframe.model import (
14     DataFrameModel as _DataFrameModel,
15     get_dtype_kwargs,
16 )
17 from pandera.api.dataframe.model_components import FieldInfo
18 from pandera.api.polars.container import DataFrameSchema
19 from pandera.api.polars.components import Column
20 from pandera.api.polars.model_config import BaseConfig
21 from pandera.engines import polars_engine as pe
22 from pandera.errors import SchemaInitError
23 from pandera.typing import AnnotationInfo
24 
25 
26 class DataFrameModel(_DataFrameModel[pl.LazyFrame, DataFrameSchema]):
27     """Model of a polars :class:`~pandera.api.pandas.container.DataFrameSchema`.
28 
29     See the :ref:`User Guide <dataframe-models>` for more.
30     """
31 
32     Config: Type[BaseConfig] = BaseConfig
33 
34     @classmethod
35     def build_schema_(cls, **kwargs):
36         return DataFrameSchema(
37             cls._build_columns(cls.__fields__, cls.__checks__),
38             checks=cls.__root_checks__,
39             **kwargs,
40         )
41 
42     @classmethod
43     def _build_columns(  # pylint:disable=too-many-locals
44         cls,
45         fields: Dict[str, Tuple[AnnotationInfo, FieldInfo]],
46         checks: Dict[str, List[Check]],
47     ) -> Dict[str, Column]:
48 
49         columns: Dict[str, Column] = {}
50         for field_name, (annotation, field) in fields.items():
51             field_checks = checks.get(field_name, [])
52             field_name = field.name
53             check_name = getattr(field, "check_name", None)
54 
55             engine_dtype = None
56             try:
57                 engine_dtype = pe.Engine.dtype(annotation.raw_annotation)
58                 dtype = engine_dtype.type
59             except TypeError as exc:
60                 if annotation.metadata:
61                     if field.dtype_kwargs:
62                         raise TypeError(
63                             "Cannot specify redundant 'dtype_kwargs' "
64                             + f"for {annotation.raw_annotation}."
65                             + "\n Usage Tip: Drop 'typing.Annotated'."
66                         ) from exc
67                     dtype_kwargs = get_dtype_kwargs(annotation)
68                     dtype = annotation.arg(**dtype_kwargs)  # type: ignore
69                 elif annotation.default_dtype:
70                     dtype = annotation.default_dtype
71                 else:
72                     dtype = annotation.arg
73 
74             if (
75                 annotation.origin is None
76                 or isinstance(annotation.origin, pl.datatypes.DataTypeClass)
77                 or engine_dtype
78             ):
79                 if check_name is False:
80                     raise SchemaInitError(
81                         f"'check_name' is not supported for {field_name}."
82                     )
83 
84                 column_kwargs = (
85                     field.column_properties(
86                         dtype,
87                         required=not annotation.optional,
88                         checks=field_checks,
89                         name=field_name,
90                     )
91                     if field
92                     else {}
93                 )
94                 columns[field_name] = Column(**column_kwargs)
95 
96             else:
97                 origin_name = (
98                     f"{annotation.origin.__module__}."
99                     f"{annotation.origin.__name__}"
100                 )
101                 msg = (
102                     " Series[TYPE] annotations are not supported for polars. "
103                     "Use the bare TYPE directly"
104                     if origin_name == "pandera.typing.pandas.Series"
105                     else ""
106                 )
107                 raise SchemaInitError(
108                     f"Invalid annotation '{field_name}: "
109                     f"{annotation.raw_annotation}'.{msg}"
110                 )
111 
112         return columns
113 
114     @classmethod
115     def to_json_schema(cls):
116         """Serialize schema metadata into json-schema format.
117 
118         :param dataframe_schema: schema to write to json-schema format.
119 
120         .. note::
121 
122             This function is currently does not fully specify a pandera schema,
123             and is primarily used internally to render OpenAPI docs via the
124             FastAPI integration.
125         """
126         schema = cls.to_schema()
127         empty = pd.DataFrame(columns=schema.columns.keys()).astype(
128             {k: v.type for k, v in schema.dtypes.items()}
129         )
130         table_schema = pd.io.json.build_table_schema(empty)
131 
132         def _field_json_schema(field):
133             return {
134                 "type": "array",
135                 "items": {"type": field["type"]},
136             }
137 
138         return {
139             "title": schema.name or "pandera.DataFrameSchema",
140             "type": "object",
141             "properties": {
142                 field["name"]: _field_json_schema(field)
143                 for field in table_schema["fields"]
144             },
145         }
146
```

Path: `pandera/typing/polars.py`
Content:
```
1 """Pandera type annotations for Polars."""
2 
3 from typing import TYPE_CHECKING, Generic, TypeVar
4 
5 from packaging import version
6 
7 from pandera.typing.common import DataFrameBase, DataFrameModel
8 
9 
10 try:
11     import polars as pl
12 
13     POLARS_INSTALLED = True
14 except ImportError:
15     POLARS_INSTALLED = False
16 
17 
18 def polars_version():
19     """Return the modin version."""
20     return version.parse(pl.__version__)
21 
22 
23 # pylint:disable=invalid-name
24 if TYPE_CHECKING:
25     T = TypeVar("T")  # pragma: no cover
26 else:
27     T = DataFrameModel
28 
29 
30 if POLARS_INSTALLED:
31     # pylint: disable=too-few-public-methods
32     class LazyFrame(DataFrameBase, pl.LazyFrame, Generic[T]):
33         """
34         Pandera generic for pl.LazyFrame, only used for type annotation.
35 
36         *new in 0.19.0*
37         """
38
```
--- 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/api/polars/model.py b/pandera/api/polars/model.py
--- a/pandera/api/polars/model.py
+++ b/pandera/api/polars/model.py
@@ -21,6 +21,7 @@
 from pandera.engines import polars_engine as pe
 from pandera.errors import SchemaInitError
 from pandera.typing import AnnotationInfo
+from pandera.typing.polars import Series
 
 
 class DataFrameModel(_DataFrameModel[pl.LazyFrame, DataFrameSchema]):
@@ -74,6 +75,7 @@
             if (
                 annotation.origin is None
                 or isinstance(annotation.origin, pl.datatypes.DataTypeClass)
+                or annotation.origin is Series
                 or engine_dtype
             ):
                 if check_name is False:
@@ -94,19 +96,9 @@
                 columns[field_name] = Column(**column_kwargs)
 
             else:
-                origin_name = (
-                    f"{annotation.origin.__module__}."
-                    f"{annotation.origin.__name__}"
-                )
-                msg = (
-                    " Series[TYPE] annotations are not supported for polars. "
-                    "Use the bare TYPE directly"
-                    if origin_name == "pandera.typing.pandas.Series"
-                    else ""
-                )
                 raise SchemaInitError(
                     f"Invalid annotation '{field_name}: "
-                    f"{annotation.raw_annotation}'.{msg}"
+                    f"{annotation.raw_annotation}'."
                 )
 
         return columns
diff --git a/pandera/typing/polars.py b/pandera/typing/polars.py
--- a/pandera/typing/polars.py
+++ b/pandera/typing/polars.py
@@ -4,7 +4,11 @@
 
 from packaging import version
 
-from pandera.typing.common import DataFrameBase, DataFrameModel
+from pandera.typing.common import (
+    DataFrameBase,
+    DataFrameModel,
+    SeriesBase,
+)
 
 
 try:
@@ -35,3 +39,11 @@
 
         *new in 0.19.0*
         """
+
+    # pylint: disable=too-few-public-methods
+    class Series(SeriesBase, pl.Series, Generic[T]):
+        """
+        Pandera generic for pl.Series, only used for type annotation.
+
+        *new in 0.19.0*
+        """

{"golden_diff": "diff --git a/pandera/api/polars/model.py b/pandera/api/polars/model.py\n--- a/pandera/api/polars/model.py\n+++ b/pandera/api/polars/model.py\n@@ -21,6 +21,7 @@\n from pandera.engines import polars_engine as pe\n from pandera.errors import SchemaInitError\n from pandera.typing import AnnotationInfo\n+from pandera.typing.polars import Series\n \n \n class DataFrameModel(_DataFrameModel[pl.LazyFrame, DataFrameSchema]):\n@@ -74,6 +75,7 @@\n             if (\n                 annotation.origin is None\n                 or isinstance(annotation.origin, pl.datatypes.DataTypeClass)\n+                or annotation.origin is Series\n                 or engine_dtype\n             ):\n                 if check_name is False:\n@@ -94,19 +96,9 @@\n                 columns[field_name] = Column(**column_kwargs)\n \n             else:\n-                origin_name = (\n-                    f\"{annotation.origin.__module__}.\"\n-                    f\"{annotation.origin.__name__}\"\n-                )\n-                msg = (\n-                    \" Series[TYPE] annotations are not supported for polars. \"\n-                    \"Use the bare TYPE directly\"\n-                    if origin_name == \"pandera.typing.pandas.Series\"\n-                    else \"\"\n-                )\n                 raise SchemaInitError(\n                     f\"Invalid annotation '{field_name}: \"\n-                    f\"{annotation.raw_annotation}'.{msg}\"\n+                    f\"{annotation.raw_annotation}'.\"\n                 )\n \n         return columns\ndiff --git a/pandera/typing/polars.py b/pandera/typing/polars.py\n--- a/pandera/typing/polars.py\n+++ b/pandera/typing/polars.py\n@@ -4,7 +4,11 @@\n \n from packaging import version\n \n-from pandera.typing.common import DataFrameBase, DataFrameModel\n+from pandera.typing.common import (\n+    DataFrameBase,\n+    DataFrameModel,\n+    SeriesBase,\n+)\n \n \n try:\n@@ -35,3 +39,11 @@\n \n         *new in 0.19.0*\n         \"\"\"\n+\n+    # pylint: disable=too-few-public-methods\n+    class Series(SeriesBase, pl.Series, Generic[T]):\n+        \"\"\"\n+        Pandera generic for pl.Series, only used for type annotation.\n+\n+        *new in 0.19.0*\n+        \"\"\"\n", "issue": "Add a polars `Series` type\n**Is your feature request related to a problem? Please describe.**\r\nThis would provide a similar `pandera.typing.Series` type for the polars API that exists for pandas and other backends. It is not strictly necessary since it does not get checked, but it would be good to have to match the existing API and to help type checkers understand accessing string column names from the class attribute names.\r\n\r\n**Describe the solution you'd like**\r\nAllow for annotating polars data frame fields as:\r\n```python\r\nimport pandera.polars as pa\r\nfrom pandera.typing.polars import Series\r\n\r\nclass MySchema(pa.DataFrameModel):\r\n    a: Series[int]\r\n```\r\n\n", "before_files": [{"content": "\"\"\"Class-based api for polars models.\"\"\"\n\nfrom typing import (\n    Dict,\n    List,\n    Tuple,\n    Type,\n)\n\nimport pandas as pd\nimport polars as pl\nfrom pandera.api.checks import Check\nfrom pandera.api.dataframe.model import (\n    DataFrameModel as _DataFrameModel,\n    get_dtype_kwargs,\n)\nfrom pandera.api.dataframe.model_components import FieldInfo\nfrom pandera.api.polars.container import DataFrameSchema\nfrom pandera.api.polars.components import Column\nfrom pandera.api.polars.model_config import BaseConfig\nfrom pandera.engines import polars_engine as pe\nfrom pandera.errors import SchemaInitError\nfrom pandera.typing import AnnotationInfo\n\n\nclass DataFrameModel(_DataFrameModel[pl.LazyFrame, DataFrameSchema]):\n    \"\"\"Model of a polars :class:`~pandera.api.pandas.container.DataFrameSchema`.\n\n    See the :ref:`User Guide <dataframe-models>` for more.\n    \"\"\"\n\n    Config: Type[BaseConfig] = BaseConfig\n\n    @classmethod\n    def build_schema_(cls, **kwargs):\n        return DataFrameSchema(\n            cls._build_columns(cls.__fields__, cls.__checks__),\n            checks=cls.__root_checks__,\n            **kwargs,\n        )\n\n    @classmethod\n    def _build_columns(  # pylint:disable=too-many-locals\n        cls,\n        fields: Dict[str, Tuple[AnnotationInfo, FieldInfo]],\n        checks: Dict[str, List[Check]],\n    ) -> Dict[str, Column]:\n\n        columns: Dict[str, Column] = {}\n        for field_name, (annotation, field) in fields.items():\n            field_checks = checks.get(field_name, [])\n            field_name = field.name\n            check_name = getattr(field, \"check_name\", None)\n\n            engine_dtype = None\n            try:\n                engine_dtype = pe.Engine.dtype(annotation.raw_annotation)\n                dtype = engine_dtype.type\n            except TypeError as exc:\n                if annotation.metadata:\n                    if field.dtype_kwargs:\n                        raise TypeError(\n                            \"Cannot specify redundant 'dtype_kwargs' \"\n                            + f\"for {annotation.raw_annotation}.\"\n                            + \"\\n Usage Tip: Drop 'typing.Annotated'.\"\n                        ) from exc\n                    dtype_kwargs = get_dtype_kwargs(annotation)\n                    dtype = annotation.arg(**dtype_kwargs)  # type: ignore\n                elif annotation.default_dtype:\n                    dtype = annotation.default_dtype\n                else:\n                    dtype = annotation.arg\n\n            if (\n                annotation.origin is None\n                or isinstance(annotation.origin, pl.datatypes.DataTypeClass)\n                or engine_dtype\n            ):\n                if check_name is False:\n                    raise SchemaInitError(\n                        f\"'check_name' is not supported for {field_name}.\"\n                    )\n\n                column_kwargs = (\n                    field.column_properties(\n                        dtype,\n                        required=not annotation.optional,\n                        checks=field_checks,\n                        name=field_name,\n                    )\n                    if field\n                    else {}\n                )\n                columns[field_name] = Column(**column_kwargs)\n\n            else:\n                origin_name = (\n                    f\"{annotation.origin.__module__}.\"\n                    f\"{annotation.origin.__name__}\"\n                )\n                msg = (\n                    \" Series[TYPE] annotations are not supported for polars. \"\n                    \"Use the bare TYPE directly\"\n                    if origin_name == \"pandera.typing.pandas.Series\"\n                    else \"\"\n                )\n                raise SchemaInitError(\n                    f\"Invalid annotation '{field_name}: \"\n                    f\"{annotation.raw_annotation}'.{msg}\"\n                )\n\n        return columns\n\n    @classmethod\n    def to_json_schema(cls):\n        \"\"\"Serialize schema metadata into json-schema format.\n\n        :param dataframe_schema: schema to write to json-schema format.\n\n        .. note::\n\n            This function is currently does not fully specify a pandera schema,\n            and is primarily used internally to render OpenAPI docs via the\n            FastAPI integration.\n        \"\"\"\n        schema = cls.to_schema()\n        empty = pd.DataFrame(columns=schema.columns.keys()).astype(\n            {k: v.type for k, v in schema.dtypes.items()}\n        )\n        table_schema = pd.io.json.build_table_schema(empty)\n\n        def _field_json_schema(field):\n            return {\n                \"type\": \"array\",\n                \"items\": {\"type\": field[\"type\"]},\n            }\n\n        return {\n            \"title\": schema.name or \"pandera.DataFrameSchema\",\n            \"type\": \"object\",\n            \"properties\": {\n                field[\"name\"]: _field_json_schema(field)\n                for field in table_schema[\"fields\"]\n            },\n        }\n", "path": "pandera/api/polars/model.py"}, {"content": "\"\"\"Pandera type annotations for Polars.\"\"\"\n\nfrom typing import TYPE_CHECKING, Generic, TypeVar\n\nfrom packaging import version\n\nfrom pandera.typing.common import DataFrameBase, DataFrameModel\n\n\ntry:\n    import polars as pl\n\n    POLARS_INSTALLED = True\nexcept ImportError:\n    POLARS_INSTALLED = False\n\n\ndef polars_version():\n    \"\"\"Return the modin version.\"\"\"\n    return version.parse(pl.__version__)\n\n\n# pylint:disable=invalid-name\nif TYPE_CHECKING:\n    T = TypeVar(\"T\")  # pragma: no cover\nelse:\n    T = DataFrameModel\n\n\nif POLARS_INSTALLED:\n    # pylint: disable=too-few-public-methods\n    class LazyFrame(DataFrameBase, pl.LazyFrame, Generic[T]):\n        \"\"\"\n        Pandera generic for pl.LazyFrame, only used for type annotation.\n\n        *new in 0.19.0*\n        \"\"\"\n", "path": "pandera/typing/polars.py"}], "after_files": [{"content": "\"\"\"Class-based api for polars models.\"\"\"\n\nfrom typing import (\n    Dict,\n    List,\n    Tuple,\n    Type,\n)\n\nimport pandas as pd\nimport polars as pl\nfrom pandera.api.checks import Check\nfrom pandera.api.dataframe.model import (\n    DataFrameModel as _DataFrameModel,\n    get_dtype_kwargs,\n)\nfrom pandera.api.dataframe.model_components import FieldInfo\nfrom pandera.api.polars.container import DataFrameSchema\nfrom pandera.api.polars.components import Column\nfrom pandera.api.polars.model_config import BaseConfig\nfrom pandera.engines import polars_engine as pe\nfrom pandera.errors import SchemaInitError\nfrom pandera.typing import AnnotationInfo\nfrom pandera.typing.polars import Series\n\n\nclass DataFrameModel(_DataFrameModel[pl.LazyFrame, DataFrameSchema]):\n    \"\"\"Model of a polars :class:`~pandera.api.pandas.container.DataFrameSchema`.\n\n    See the :ref:`User Guide <dataframe-models>` for more.\n    \"\"\"\n\n    Config: Type[BaseConfig] = BaseConfig\n\n    @classmethod\n    def build_schema_(cls, **kwargs):\n        return DataFrameSchema(\n            cls._build_columns(cls.__fields__, cls.__checks__),\n            checks=cls.__root_checks__,\n            **kwargs,\n        )\n\n    @classmethod\n    def _build_columns(  # pylint:disable=too-many-locals\n        cls,\n        fields: Dict[str, Tuple[AnnotationInfo, FieldInfo]],\n        checks: Dict[str, List[Check]],\n    ) -> Dict[str, Column]:\n\n        columns: Dict[str, Column] = {}\n        for field_name, (annotation, field) in fields.items():\n            field_checks = checks.get(field_name, [])\n            field_name = field.name\n            check_name = getattr(field, \"check_name\", None)\n\n            engine_dtype = None\n            try:\n                engine_dtype = pe.Engine.dtype(annotation.raw_annotation)\n                dtype = engine_dtype.type\n            except TypeError as exc:\n                if annotation.metadata:\n                    if field.dtype_kwargs:\n                        raise TypeError(\n                            \"Cannot specify redundant 'dtype_kwargs' \"\n                            + f\"for {annotation.raw_annotation}.\"\n                            + \"\\n Usage Tip: Drop 'typing.Annotated'.\"\n                        ) from exc\n                    dtype_kwargs = get_dtype_kwargs(annotation)\n                    dtype = annotation.arg(**dtype_kwargs)  # type: ignore\n                elif annotation.default_dtype:\n                    dtype = annotation.default_dtype\n                else:\n                    dtype = annotation.arg\n\n            if (\n                annotation.origin is None\n                or isinstance(annotation.origin, pl.datatypes.DataTypeClass)\n                or annotation.origin is Series\n                or engine_dtype\n            ):\n                if check_name is False:\n                    raise SchemaInitError(\n                        f\"'check_name' is not supported for {field_name}.\"\n                    )\n\n                column_kwargs = (\n                    field.column_properties(\n                        dtype,\n                        required=not annotation.optional,\n                        checks=field_checks,\n                        name=field_name,\n                    )\n                    if field\n                    else {}\n                )\n                columns[field_name] = Column(**column_kwargs)\n\n            else:\n                raise SchemaInitError(\n                    f\"Invalid annotation '{field_name}: \"\n                    f\"{annotation.raw_annotation}'.\"\n                )\n\n        return columns\n\n    @classmethod\n    def to_json_schema(cls):\n        \"\"\"Serialize schema metadata into json-schema format.\n\n        :param dataframe_schema: schema to write to json-schema format.\n\n        .. note::\n\n            This function is currently does not fully specify a pandera schema,\n            and is primarily used internally to render OpenAPI docs via the\n            FastAPI integration.\n        \"\"\"\n        schema = cls.to_schema()\n        empty = pd.DataFrame(columns=schema.columns.keys()).astype(\n            {k: v.type for k, v in schema.dtypes.items()}\n        )\n        table_schema = pd.io.json.build_table_schema(empty)\n\n        def _field_json_schema(field):\n            return {\n                \"type\": \"array\",\n                \"items\": {\"type\": field[\"type\"]},\n            }\n\n        return {\n            \"title\": schema.name or \"pandera.DataFrameSchema\",\n            \"type\": \"object\",\n            \"properties\": {\n                field[\"name\"]: _field_json_schema(field)\n                for field in table_schema[\"fields\"]\n            },\n        }\n", "path": "pandera/api/polars/model.py"}, {"content": "\"\"\"Pandera type annotations for Polars.\"\"\"\n\nfrom typing import TYPE_CHECKING, Generic, TypeVar\n\nfrom packaging import version\n\nfrom pandera.typing.common import (\n    DataFrameBase,\n    DataFrameModel,\n    SeriesBase,\n)\n\n\ntry:\n    import polars as pl\n\n    POLARS_INSTALLED = True\nexcept ImportError:\n    POLARS_INSTALLED = False\n\n\ndef polars_version():\n    \"\"\"Return the modin version.\"\"\"\n    return version.parse(pl.__version__)\n\n\n# pylint:disable=invalid-name\nif TYPE_CHECKING:\n    T = TypeVar(\"T\")  # pragma: no cover\nelse:\n    T = DataFrameModel\n\n\nif POLARS_INSTALLED:\n    # pylint: disable=too-few-public-methods\n    class LazyFrame(DataFrameBase, pl.LazyFrame, Generic[T]):\n        \"\"\"\n        Pandera generic for pl.LazyFrame, only used for type annotation.\n\n        *new in 0.19.0*\n        \"\"\"\n\n    # pylint: disable=too-few-public-methods\n    class Series(SeriesBase, pl.Series, Generic[T]):\n        \"\"\"\n        Pandera generic for pl.Series, only used for type annotation.\n\n        *new in 0.19.0*\n        \"\"\"\n", "path": "pandera/typing/polars.py"}]}