Will Gunadi
12/29/2021, 10:04 PMChris Retford
12/29/2021, 10:13 PMWill Gunadi
12/29/2021, 10:16 PM@op
def someOp(context, first_input):
like that?
So how do I invoke this op in a job?Chris Retford
12/29/2021, 10:17 PMsomeOp(first_input)
Will Gunadi
12/29/2021, 10:18 PMChris Retford
12/29/2021, 10:18 PMWill Gunadi
12/29/2021, 10:46 PMIn @job some_job, received invalid type <class 'str'> for input "import_ts" (at position 0) in op invocation "incremental_merge". Must pass the output from previous node invocations or inputs to the composition function as inputs when invoking nodes during composition.
@op
def incremental_merge(context, import_ts, table_name):
and the invocation:
incremental_merge(import_ts, table_name)
Chris Retford
12/29/2021, 10:58 PM@op decorated functions should only have keyword arguments that match input names and, if system information is required, a first positional parameter named 'context'.
@op
def get_import_ts():
# code to generate whatever import_ts is
return import_ts
Will Gunadi
12/29/2021, 11:07 PMChris Retford
12/29/2021, 11:07 PM@op(config_schema={"table_name":str})
def incremental_merge(context, import_ts):
Will Gunadi
12/29/2021, 11:08 PMChris Retford
12/29/2021, 11:08 PMWill Gunadi
12/30/2021, 3:07 PMIn the end, this is the one that works:
yield asset
yield Output('2021-12-29', 'import_ts')
yield Output('dummy', 'table_name')
Would be a great addition to the documentation.Chris Retford
12/30/2021, 3:29 PMWill Gunadi
12/31/2021, 5:45 PMmetadata = [<http://EventMetadataEntry.int|EventMetadataEntry.int>(
value=nrc, label=f"New Rows Count"
)]
asset = AssetMaterialization(
description=f"BB dummy", metadata_entries=metadata,asset_key=f'bb_repository.dummy_load',
)
yield asset
yield Output('2021-12-29', 'import_ts')
yield Output('dummy', 'table_name')