Skip to content

Commit

Permalink
issue #28 Change the operation IDs type from string to integer
Browse files Browse the repository at this point in the history
  • Loading branch information
wajda committed Aug 9, 2023
1 parent 1929b58 commit 9061459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/spline_agent/harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ def harvest_lineage(
cur_time = current_time()

write_operation = WriteOperation(
id='op-0',
childIds=('op-1',),
id=0,
childIds=(1,),
name='Write', # todo: put something more meaningful here, maybe 'write to {ds.type}' (issue #15)
outputSource=ctx.output.url,
append=ctx.write_mode == WriteMode.APPEND,
)

read_operations = tuple(
ReadOperation(
id=f'op-{i + 2}',
id=i + 2,
inputSources=(inp.url,),
name='Read', # todo: put something more meaningful here, maybe 'read from {ds.type}' (issue #15)
) for i, inp in zip(range(len(ctx.inputs)), ctx.inputs))
Expand Down Expand Up @@ -102,8 +102,8 @@ def _process_func(ctx: LineageTrackingContext, func: Callable) -> tuple[DataOper
file_name = inspect.getfile(func)

operation = DataOperation(
id='op-1',
childIds=tuple(f'op-{i + 2}' for i in range(len(ctx.inputs))),
id=1,
childIds=tuple(i + 2 for i in range(len(ctx.inputs))),
name='Python script',
extra={
'function_name': func_name,
Expand Down
2 changes: 1 addition & 1 deletion src/spline_agent/lineage_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
DurationNs = int

# Represents an execution plan operation ID as string, e.g. 'op-123'
OperationId = str
OperationId = int


@dataclass
Expand Down

0 comments on commit 9061459

Please sign in to comment.