From 93e8015dddb8e5bde3af4fcaf0e9c1a38db51a50 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Fri, 3 Sep 2021 10:37:06 -0400 Subject: [PATCH] Read the spreadsheet data sent from the front end. This allows pandas to see it as a file type object. Fixed bug where column_count wouldn't get set if there isn't an Annotation column --- crc/services/file_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crc/services/file_service.py b/crc/services/file_service.py index 8f21eb8f..ff1dfcb5 100644 --- a/crc/services/file_service.py +++ b/crc/services/file_service.py @@ -453,7 +453,7 @@ class FileService(object): return True return False - df = pd.read_excel(io.BytesIO(ss_data), header=None) + df = pd.read_excel(io.BytesIO(ss_data.read()), header=None) root = etree.Element("definitions", xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd", @@ -491,11 +491,11 @@ class FileService(object): label=label, name=name, typeRef=type_ref)) output_count += 1 elif item == 'Annotation': - column_count = count break count += 1 row = 6 + column_count = count while row < df.shape[0]: column = 1 row_values = df.iloc[row].values[1:column_count]