https://dagster.io/ logo
Title
j

Jordan

04/11/2023, 10:46 AM
Hi ! I use a
multi_asset_sensor
to detect materialization of a non-partitioned job, I saw that the method
latest_materialization_records_by_key
can be very useful in some cases. However I would like to have all materializations per key that occurred after the cursor and not only the last one. Is there a way to do this? Thanks in advance
c

claire

04/11/2023, 6:14 PM
Hi Jordan. You can instead call
context.materialization_records_for_key
, which will search for all events after the cursor for the given asset key. There is also a
limit
param so you can limit the number of returned records
j

Jordan

04/11/2023, 8:40 PM
Thanks Claire. Ideally I would like to not have this
limit
setting to make sure I get all the records. If I propose a PR making the limit parameter optional, do you think it could be approved?
c

claire

04/11/2023, 8:41 PM
Yep, feel free to tag me on that PR
get_event_records
(which is a public API) has the limit arg as optional, so I don't see why we shouldn't support the same thing within the multi asset sensor
👍 1
j

Jordan

04/11/2023, 10:52 PM