You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[types] incomptabile assignment types due to invariant and type union #90
The type checkers are really unhappy with the way that the types are currently formulated. I should be able to supply a list of just RegularCollectionFieldSchema to CollectionUpdateSchema. Instead it errors due to the type construction. I shouldn't have to reverse engineer the internal union type to satisfy the type checker.
That's due to the nominality of the type system. The solution you propose involves generating generics for all possible unions, and we can take a look into making those changes. Any other places where you've noticed this behavior, apart from the collection update operation?
Activity
tharropoulos commentedon Jun 17, 2025
That's due to the nominality of the type system. The solution you propose involves generating generics for all possible unions, and we can take a look into making those changes. Any other places where you've noticed this behavior, apart from the collection update operation?
rchui commentedon Jun 17, 2025
Collection create operation also gives me a similar error: https://github.com/typesense/typesense-python/blob/master/src/typesense/types/collection.py#L176
I'm sure there are others too
rchui commentedon Nov 15, 2025
@tharropoulos I ended up working around this by adding a bunch of
type: ignorecomments. This change would still be highly appreciated.