Rubén Briones
03/22/2023, 9:11 AMasset_sensor
??
I have this code that allows me to access the metadata, but I don't know how to access the output itself (the dataframe returned by the asset):
@asset
def foo():
return Output(
pd.DataFrame({'data1': ['A', 'B'], 'data2': ['AA', 'BB']}),
metadata={'meta1': 1, 'meta2': 2}
)
@asset_sensor(asset_key=AssetKey("foo"), job=my_job)
def my_asset_sensor(context: SensorEvaluationContext, asset_event: EventLogEntry):
asset_materialization = asset_event.dagster_event.event_specific_data.materialization
metadata = {entry.label: entry.entry_data for entry in asset_materialization.metadata_entries}
...
I want to return a RunRequest
for each row in the dataframe returned by foo
asset.jamie
03/22/2023, 3:00 PMRubén Briones
03/22/2023, 4:16 PMpd.DataFrame
with a list of items (rows are items, and columns are their characteristics), and we have model that as an asset
. And now we want to run an asset/job/op that for each row of the dataframe check if this product exists in our DDBB, and if not create it (insert new row in DDBB items table).Vinnie
03/22/2023, 4:18 PMjamie
03/22/2023, 4:49 PM