Luke Dziurzynski
08/06/2023, 10:55 PM@asset
def users() -> pd.DataFrame:
return pd.read_csv("./data/users.csv").head(4)
@asset_sensor(asset_key=AssetKey("users"))
def user_sensor(context: SensorEvaluationContext, asset_event: EventLogEntry):
yield RunRequest(partition_key=asset_event.asset_materialization.metadata["partition_key"])
It is very unclear what I'm supposed to do next. I have been hopping around between documentation for sensors, asset sensors, @claire's slack messages, context.cursor, dynamic partitions, and the dynamic partitions example from github and am suuuuuper lost. What do I do next to run a function that receives that new dynamic partition value and writes an asset?Tim Castillo
08/07/2023, 4:17 PMusers
asset will kick off a run and you can access the run's partition key with `
context.asset_partition_key_for_output()
`, as you would with other partitioned assets.
At that point, it's up to the user to decide what the logic is to use that information about the partition themselves. ie. using that key query a database or upsert a record somewhere.