Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/core/parsers/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def parse_line(self, row, header):
current_value = {"type": "string", "value": cell_value}

header_value = header[index] # HEADER VALUE
debuginfo = f"header[{index}]={header[index]!r}\n{cell_value=},"

if index == 0: # That is the QID, alway in the firs column
if not cell_value:
Expand Down Expand Up @@ -146,7 +147,7 @@ def parse_line(self, row, header):
current_command["value"]["value"]
]

commands.append(current_command)
commands.append((debuginfo, current_command))
Comment thread
arcstur marked this conversation as resolved.

return commands

Expand Down Expand Up @@ -194,7 +195,7 @@ def parse(self, raw_csv) -> Iterator[BatchCommand]:
first_line = False
else:
commands = self.parse_line(row, header)
for command in commands:
for debuginfo, command in commands:
action = BatchCommand.ACTION_CREATE
operation = None
if command["action"] == "add":
Expand All @@ -221,7 +222,7 @@ def parse(self, raw_csv) -> Iterator[BatchCommand]:
yield BatchCommand(
index=index,
json=command,
raw=row,
raw=debuginfo,
action=action,
operation=operation,
status=BatchCommand.STATUS_INITIAL,
Expand Down
Loading