I am trying to use `materialize()` to materialize ...
# ask-community
a
I am trying to use
materialize()
to materialize an asset from an Op but I am getting this error -
Copy code
dagster._check.CheckError: Failure condition: The instance is not available to load partitions. You may be seeing this error when using dynamic partitions with a version of dagit or dagster-cloud that is older than 1.1.18
What is the proper usage in order to avoid this failure condition?
o
hi @Aaron T! can you share how you're invoking
materialize()
? I would expect passing in
instance=context.instance
would resolve this.
a
I think I have narrowed down the issue to me materializing a dynamically partitioned asset, and I am now getting
Could not find a partition with key..
. My idea was to generate a partition key with an Op, then in another Op, materialize an asset with the newly generated partition key
also, your expectation was correct.
o
gotcha — i’ll tag @claire on this as she’s been thinking about this sort of workflow
a
Thanks, I see this can be done for a Sensor, but a Sensor doesn't work for my case.
c
Hey Aaron, for now, in a situation like this, you would need to have an upstream unpartitioned asset that adds the partition key. Then a downstream asset that is partitioned with the dynamic partitions def can execute on the newly generated partition key.
Wondering what your use case is for doing something like this? We are thinking of improvements that might be what you're looking for. Here's an API proposal if you have any thoughts: https://github.com/dagster-io/dagster/issues/9559
👍 1
a
Thanks for pointing me to that @claire. I put what I am currently using in the comments - https://github.com/dagster-io/dagster/issues/9559#issuecomment-1561853169 my use case is really to have a job (or in the git topic an asset) run and generate a new partition key and then materialize a downstream asset