Skip to content

Why does PyCheck complain about assigning T to Optional[T]? #9599

Closed Answered by xorcus
xorcus asked this question in Q&A
Discussion options

You must be logged in to vote

Turns out my problem came from another issue. The import of T (SecretStr in my case) became invalid as the type moved to another package. Originally it was:

from pydantic import SecretStr

And it had to be changed to:

from langchain_core.pydantic_v1 import SecretStr

In the end, it was a mismatch between two different SecretStr types.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xorcus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant