Jesper Bagge
02/16/2023, 7:51 AMowen
02/16/2023, 11:30 PM@asset
def dw_asset(stuff):
syncd = False
try:
result = unnest_stuff(stuff)
syncd = True
yield Output(result)
finally:
if syncd:
update_prefix("archived")
else:
update_prefix("failed")
this gets you down to just three things: a sensor, a job, and an asset. I find this somewhat appealing because it co-locates the business logic (i.e. this function tells you exactly what should happen with the input file regardless of if this operation succeeds or fails).Jesper Bagge
02/17/2023, 8:02 AM