error: Argument type is partially unknown
Argument corresponds to parameter "field" in function "__init__"
Argument type is "ForeignKey[Unknown]" (reportUnknownArgumentType)
This is because indeed db.models.fields.related.ForeignKey is defined as a Generic and pyright doesn't know what type this Generic points to, since that is encoded in the to="epcs.epc" bit which isn't even a fully importable module/class. This issue only surfaces now because I think 1.1.315 actually fixed a few bugs related to Generics as arguments in functions I think. The issue is that the stub does specify it as a generic, but pyright has no way of understanding the Django magic that tells it this one points to class ..epcs.models.EPC.
I don't know exactly what the solution is here, but pyright definitely doesn't like it.
When creating a Django migration which contains
pyright 1.1.315 and 1.1.316 complain
This is because indeed db.models.fields.related.ForeignKey is defined as a
Generic
and pyright doesn't know what type this Generic points to, since that is encoded in theto="epcs.epc"
bit which isn't even a fully importable module/class. This issue only surfaces now because I think 1.1.315 actually fixed a few bugs related to Generics as arguments in functions I think. The issue is that the stub does specify it as a generic, but pyright has no way of understanding the Django magic that tells it this one points to class..epcs.models.EPC
.I don't know exactly what the solution is here, but pyright definitely doesn't like it.