jack 1 month ago
parent
commit
d86bcb623d
1 changed files with 7 additions and 4 deletions
  1. 7 4
      py/core/parsers/structured/csv_parser.py

+ 7 - 4
py/core/parsers/structured/csv_parser.py

@@ -79,7 +79,7 @@ class CSVParserAdvanced(AsyncParser[str | bytes]):
         **kwargs,
     ) -> AsyncGenerator[str, None]:
         """Ingest CSV data and yield text from each row."""
-        print(data)
+        #print(data)
         if isinstance(data, bytes):
             try:
                 data = data.decode("utf-8")
@@ -94,14 +94,17 @@ class CSVParserAdvanced(AsyncParser[str | bytes]):
                 else:
                     raise ValueError("Unable to decode the provided byte data with any supported encoding")
         # let the first row be the header
+        print("1")
         delimiter = self.get_delimiter(file=self.StringIO(data))
-
+        print("2")
         csv_reader = self.csv.reader(self.StringIO(data), delimiter=delimiter)
-
+        print("3")
         header = next(csv_reader)
+        print("4")
         num_cols = len(header.split(delimiter))
+        print("5")
         num_rows = num_col_times_num_rows // num_cols
-
+        print("6")
         chunk_rows = []
         for row_num, row in enumerate(csv_reader):
             print(row)