Setting up my first sensor using `build_asset_reco...
# ask-community
a
Setting up my first sensor using
build_asset_reconciliation_sensor
. The sensor is queueing up some runs but they are failing and I believe it has something to do with partitioning and how the assets are defined. The error I'm seeing for all of them is:
dagster._core.errors.DagsterInvariantViolationError: Cannot access partition_key for a non-partitioned run
In the sensor cursor I'm seeing the following:
Copy code
[770136, ["asset_1", "asset_2"], {"asset_2": "{\"version\": 1, \"subset\": [\"2019-10-01\", \"2019-11-01\"]}", "asset_1": "{\"version\": 1, \"time_windows\": [[1679184000.0, 1679270400.0]], \"num_partitions\": 1}"}]
The error looks to occur when I access
context.partition_key
. Do the partitioned jobs need to be able to handle multiple partitions in their run?
Should I be writing all my partitioned assets to use
context.asset_partition_keys_for_output()
and if so, would I be able to dynamically yield multiple `Output`s? Or should
build_asset_reconciliation_sensor
be launching individual runs for each partition?
s
Or should
build_asset_reconciliation_sensor
be launching individual runs for each partition?
It should be launching individual runs for each partition