@rubytech/create-maxy 1.0.769 → 1.0.771
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -184,10 +184,15 @@ def cypher(query: str, params: dict | None = None) -> str:
|
|
|
184
184
|
|
|
185
185
|
def parse_csv_rows(stdout: str) -> list[dict]:
|
|
186
186
|
"""cypher-shell --format plain emits a CSV header + rows. The csv module
|
|
187
|
-
handles quoting reliably even when text contains commas/quotes/newlines.
|
|
187
|
+
handles quoting reliably even when text contains commas/quotes/newlines.
|
|
188
|
+
|
|
189
|
+
skipinitialspace=True is required because cypher-shell emits a space
|
|
190
|
+
after each comma in both header and data rows (`id, firstLabel, text`),
|
|
191
|
+
and DictReader otherwise treats the spaces as part of the column name —
|
|
192
|
+
`row["text"]` raises KeyError because the actual key is " text"."""
|
|
188
193
|
if not stdout.strip():
|
|
189
194
|
return []
|
|
190
|
-
reader = csv.DictReader(StringIO(stdout))
|
|
195
|
+
reader = csv.DictReader(StringIO(stdout), skipinitialspace=True)
|
|
191
196
|
return list(reader)
|
|
192
197
|
|
|
193
198
|
|