Skip to content

CI: latest ty release breaks CI #1482

@MarcoGorelli

Description

@MarcoGorelli

with the latest ty release, on the main branch, I see:

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:507:49
    |
506 | # DtypeArg specifies all allowable dtypes in a functions its dtype argument
507 | DtypeArg: TypeAlias = Dtype | Mapping[Hashable, Dtype]
    |                                                 ^^^^^
508 | DtypeObj: TypeAlias = np.dtype[np.generic] | ExtensionDtype
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:527:56
    |
526 | # converters
527 | ConvertersArg: TypeAlias = Mapping[Hashable, Callable[[Dtype], Dtype]]
    |                                                        ^^^^^
528 |
529 | # parse_dates
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:527:64
    |
526 | # converters
527 | ConvertersArg: TypeAlias = Mapping[Hashable, Callable[[Dtype], Dtype]]
    |                                                                ^^^^^
528 |
529 | # parse_dates
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:927:26
    |
925 |     | datetime.timedelta  # includes pd.Timedelta
926 | )
927 | S1 = TypeVar("S1", bound=SeriesDType, default=Any)
    |                          ^^^^^^^^^^^
928 | # Like S1, but without `default=Any`.
929 | S2 = TypeVar("S2", bound=SeriesDType)
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:929:26
    |
927 | S1 = TypeVar("S1", bound=SeriesDType, default=Any)
928 | # Like S1, but without `default=Any`.
929 | S2 = TypeVar("S2", bound=SeriesDType)
    |                          ^^^^^^^^^^^
930 | S2_contra = TypeVar("S2_contra", bound=SeriesDType, contravariant=True)
931 | S2_NDT_contra = TypeVar(
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:930:40
    |
928 | # Like S1, but without `default=Any`.
929 | S2 = TypeVar("S2", bound=SeriesDType)
930 | S2_contra = TypeVar("S2_contra", bound=SeriesDType, contravariant=True)
    |                                        ^^^^^^^^^^^
931 | S2_NDT_contra = TypeVar(
932 |     "S2_NDT_contra", bound=SeriesDTypeNoDateTime, contravariant=True
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:932:28
    |
930 | S2_contra = TypeVar("S2_contra", bound=SeriesDType, contravariant=True)
931 | S2_NDT_contra = TypeVar(
932 |     "S2_NDT_contra", bound=SeriesDTypeNoDateTime, contravariant=True
    |                            ^^^^^^^^^^^^^^^^^^^^^
933 | )
934 | S2_NSDT = TypeVar("S2_NSDT", bound=SeriesDTypeNoStrDateTime)
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:934:36
    |
932 |     "S2_NDT_contra", bound=SeriesDTypeNoDateTime, contravariant=True
933 | )
934 | S2_NSDT = TypeVar("S2_NSDT", bound=SeriesDTypeNoStrDateTime)
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^
935 | S3 = TypeVar("S3", bound=SeriesDType)
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:935:26
    |
933 | )
934 | S2_NSDT = TypeVar("S2_NSDT", bound=SeriesDTypeNoStrDateTime)
935 | S3 = TypeVar("S3", bound=SeriesDType)
    |                          ^^^^^^^^^^^
936 |
937 | # Constraint, instead of bound
    |
info: rule `invalid-type-form` is enabled by default

error[invalid-type-form]: Variable of type `UnionType` is not allowed in a type expression
   --> pandas-stubs/_typing.pyi:948:5
    |
946 |     float,
947 |     complex,
948 |     Dtype,
    |     ^^^^^
949 |     datetime.datetime,  # includes pd.Timestamp
950 |     datetime.timedelta,  # includes pd.Timedelta
    |
info: rule `invalid-type-form` is enabled by default

With the previous release, everything passes. I think that's what's affecting the failures in #1481

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions