Hi Team, I’m trying to use MonthlyPartitionsDefin...
# ask-community
s
Hi Team, I’m trying to use MonthlyPartitionsDefinition with multi_asset and it doesn’t go well with mypy, here is an sample
Copy code
from dagster import AssetOut, MonthlyPartitionsDefinition, multi_asset

@multi_asset(
    partitions_def=MonthlyPartitionsDefinition(start_date='2022-01-01'),
    outs={'test': AssetOut()},
)
def test_multi_asset():
    pass
🤖 1
Mypy error output is
Copy code
test_asset.py:5: error: Argument "partitions_def" to "multi_asset" has incompatible type "MonthlyPartitionsDefinition"; expected "Optional[PartitionsDefinition[object]]"  [arg-type]
I think we should update the type for
partitions_def
to
Optional[PartitionsDefinition[Any]]
s
Hi Sean, thanks for bringing this to our attention-- I think we will solve this by making the TypeVar for
PartitionsDefinition
covariant. Look for this in the next release.
❤️ 1