Skip to content

Commit

Permalink
main: fixed error with comma separator
Browse files Browse the repository at this point in the history
Before this patch, there was the `ValueError` on getting the node name
when the input file used comma separator instead of colon, i.e.:

```
AggregateExec, mode=Partial, gby=[], aggr=[COUNT(*)], metrics=[output_rows=32, elapsed_compute=113.653569ms]
```

This patch allows to work with any separator.

Resolves #2
  • Loading branch information
lastoCHka42 committed Jun 2, 2024
1 parent 1cc3d07 commit c74a502
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@

if __name__ == "__main__":


nodes = dict()
with open(args.input_file, 'r') as f:
source = f.readlines()

INDEX_TO_LEVEL = generate_index_to_level_dict(source)

for i in range(len(INDEX_TO_LEVEL)):
name, content_raw = source[i].strip().split(':', 1)
name, content_raw = source[i].strip().split(' ', 1)
content = (i, INDEX_TO_LEVEL[i])
node = Node(i, name, content_raw)
node = Node(i, name[0:-1], content_raw)
nodes.update({i: node})
if i == 0:
continue
Expand Down

0 comments on commit c74a502

Please sign in to comment.