https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Jonathan Ming

02/03/2023, 8:43 PM
I’ve got a multi-asset which depends on a regular asset with a static partition, and I wanted to keep the same partitioning as the upstream asset, so I added the same
partitions_def
to my multi-asset. It works totally as expected, which is great! However,
pyright
is upset about the typing of the
partitions_def
decorator argument just for the multi-asset:
Copy code
error: Argument of type "StaticPartitionsDefinition" cannot be assigned to parameter "partitions_def" of type "PartitionsDefinition[object] | None" in function "multi_asset"
    Type "StaticPartitionsDefinition" cannot be assigned to type "PartitionsDefinition[object] | None"
      "StaticPartitionsDefinition" is incompatible with "PartitionsDefinition[object]"
        TypeVar "T@PartitionsDefinition" is invariant
          "str" is incompatible with "object"
      Type cannot be assigned to type "None" (reportGeneralTypeIssues)
This is not that big of a deal for me because the assets actually do work totally fine, partitions and all 👍 But rather than slap a
type: ignore
on something I don’t understand, I thought I’d ask why this is happening — my fault? bug? What are your thoughts?
j

jamie

02/03/2023, 10:20 PM
hey @Jonathan Ming
StaticPartitionsDefinition
should be a
ParitionsDefinition
. We might have a typing bug on our end. @sean would you be able to take a look at this?
j

Jonathan Ming

02/06/2023, 5:36 PM
In case it helps, here’s a pretty minimal repro I came up with: