fix(spark-analytics): escape \\n in JS userPrompt strings

Python triple-quoted string interprets \n as literal newlines,
producing invalid JS string literals and a SyntaxError that
killed the entire script block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Janis Eccarius
2026-06-21 17:25:20 +02:00
parent 9074c3fbd0
commit 60467d8ff6
+5 -5
View File
@@ -193,11 +193,11 @@ data:
+ 'player behaviour, or game dynamics. When column names reference chess openings (ECO codes, opening names), '
+ 'explain what those openings are.';
const userPrompt = 'Dataset: "' + dataset.label + '"\n'
+ 'Total rows: ' + dataset.total_rows + '\n'
+ 'Columns: ' + dataset.headers.join(', ') + '\n\n'
+ 'Sample data (first ' + dataset.sample.length + ' rows):\n'
+ sampleText + '\n\n'
const userPrompt = 'Dataset: "' + dataset.label + '"\\n'
+ 'Total rows: ' + dataset.total_rows + '\\n'
+ 'Columns: ' + dataset.headers.join(', ') + '\\n\\n'
+ 'Sample data (first ' + dataset.sample.length + ' rows):\\n'
+ sampleText + '\\n\\n'
+ 'What does this dataset tell us about chess?';
try {