Skip to content

Commit d31938a

Browse files
committed
[sc-222037] dump non decodable returned content
1 parent c3571de commit d31938a

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

python-connectors/api-connect_dataset/connector.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,16 @@ def generate_rows(self, dataset_schema=None, dataset_partitioning=None,
5757
record_count += 1
5858
yield self.format_output(data, metadata)
5959
else:
60-
data = decode_csv_data(data)
61-
record_count += len(data)
62-
for row in data:
63-
yield self.format_output(row, metadata)
60+
csv_data = decode_csv_data(data)
61+
if csv_data:
62+
record_count += len(csv_data)
63+
for row in csv_data:
64+
yield self.format_output(row, metadata)
65+
else:
66+
record_count += 1
67+
yield {
68+
DKUConstants.API_RESPONSE_KEY: "{}".format(data.decode())
69+
}
6470
if is_records_limit and record_count >= records_limit:
6571
break
6672

0 commit comments

Comments
 (0)