Skip to content

Asset sensor internal cursor updates #27856

Open
@sharrik111

Description

@sharrik111

What's the issue or suggestion?

Dagster docs tell that users are allowed to use cursors inside sensors to retain state between sensors' evaluations. Examples for this are given for dg.sensor.

Intuitively, it's assumed that dg.asset_sensor offers similar functionality. But in fact, dg.AssetSensorDefinition uses the cursor itself to control asset materializations. Thus, cursor updates made inside a sensor function are being overriden.

I leave this issue in the area of docs since I'm not sure is it a bug or feature. For me, it's more of a bug. But if it's a feature, it should be propertly documented (e.g. here

Additional information

Here's the place in code where the cursor is being updated

context.update_cursor(str(event_record.storage_id))

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docsRelated to documentation in generalarea: sensorRelated to Sensors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions