# Buggy code
def _parse_annotation(self, raw_annotation: Type) -> None:
    """Parse key information from annotation.

    :param annotation: A subscripted type.
    :returns: Annotation
    """
    self.raw_annotation = raw_annotation

    self.optional = typing_inspect.is_optional_type(raw_annotation)
    if self.optional:
        # e.g: Typing.Union[pandera.typing.Index[str], NoneType]
        if _LEGACY_TYPING:  # pragma: no cover
            # get_args -> ((pandera.typing.Index, <class 'str'>), <class 'NoneType'>)
            self.origin, self.arg = typing_inspect.get_args(raw_annotation)[0]
            return
        # get_args -> (pandera.typing.Index[str], <class 'NoneType'>)
        raw_annotation = typing_inspect.get_args(raw_annotation)[0]

    self.origin = typing_inspect.get_origin(raw_annotation)
    args = typing_inspect.get_args(raw_annotation)
    self.arg = args[0] if args else args

    self.literal = typing_inspect.is_literal_type(self.arg)
    if self.literal:
        self.arg = typing_inspect.get_args(self.arg)[0]


# Traceback (TypeError)
TypeError                                 Traceback (most recent call last)
<ipython-input-10-1d3df28d227a> in <module>
----> 1 Schema.validate(df)

/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/socceraction/.venv/lib/python3.6/site-packages/pandera/model.py in validate(cls, check_obj, head, tail, sample, random_state, lazy)
146     ) -> pd.DataFrame:
147         """%(validate_doc)s"""
--> 148         return cls.to_schema().validate(
149             check_obj, head, tail, sample, random_state, lazy
150         )

/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/socceraction/.venv/lib/python3.6/site-packages/pandera/model.py in to_schema(cls)
119         }
120         columns, index = cls._build_columns_index(
--> 121             cls.__fields__, cls.__checks__, **mi_kwargs
122         )
123         cls.__schema__ = DataFrameSchema(

/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/socceraction/.venv/lib/python3.6/site-packages/pandera/model.py in _build_columns_index(cls, fields, checks, **multiindex_kwargs)
199                     required=not annotation.optional,
200                     checks=field_checks,
--> 201                     name=field_name,
202                 )
203             elif annotation.origin is Index:

/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/socceraction/.venv/lib/python3.6/site-packages/pandera/schema_components.py in __init__(self, pandas_dtype, checks, nullable, allow_duplicates, coerce, required, name, regex)
77         """
78         super().__init__(
---> 79             pandas_dtype, checks, nullable, allow_duplicates, coerce
80         )
81         if (

/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/socceraction/.venv/lib/python3.6/site-packages/pandera/schemas.py in __init__(self, pandas_dtype, checks, nullable, allow_duplicates, coerce, name)
1453
1454         # make sure pandas dtype is valid
-> 1455         self.dtype  # pylint: disable=pointless-statement
1456
1457         # this attribute is not meant to be accessed by users and is explicitly

/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/socceraction/.venv/lib/python3.6/site-packages/pandera/schemas.py in dtype(self)
1526     def dtype(self) -> Optional[str]:
1527         """String representation of the dtype."""
-> 1528         return PandasDtype.get_str_dtype(self._pandas_dtype)
1529
1530     @property

/cw/dtaijupiter/NoCsBack/dtai/pieterr/Projects/socceraction/.venv/lib/python3.6/site-packages/pandera/dtypes.py in get_str_dtype(cls, pandas_dtype_arg)
310             return dtype_.str_alias
311         raise TypeError(
--> 312             "type of `pandas_dtype` argument not recognized: "
313             f"{type(pandas_dtype_arg)}. Please specify a pandera PandasDtype "
314             "enum, legal pandas data type, pandas data type string alias, or "

TypeError: type of `pandas_dtype` argument not recognized: typing_extensions.Literal. Please specify a pandera PandasDtype enum, legal pandas data type, pandas data type string alias, or numpy data type string alias

# Fixed code
def _parse_annotation(self, raw_annotation: Type) -> None:
    """Parse key information from annotation.

    :param annotation: A subscripted type.
    :returns: Annotation
    """
    self.raw_annotation = raw_annotation

    self.optional = typing_inspect.is_optional_type(raw_annotation)
    if self.optional:
        # e.g: Typing.Union[pandera.typing.Index[str], NoneType]
        if _LEGACY_TYPING:  # pragma: no cover
            # get_args -> ((pandera.typing.Index, <class 'str'>), <class 'NoneType'>)
            self.origin, self.arg = typing_inspect.get_args(raw_annotation)[0]
        # get_args -> (pandera.typing.Index[str], <class 'NoneType'>)
        raw_annotation = typing_inspect.get_args(raw_annotation)[0]

    if not (self.optional and _LEGACY_TYPING):
        self.origin = typing_inspect.get_origin(raw_annotation)
        args = typing_inspect.get_args(raw_annotation)
        self.arg = args[0] if args else args

    self.literal = typing_inspect.is_literal_type(self.arg)
    if self.literal:
        self.arg = typing_inspect.get_args(self.arg)[0]