From bfb0e71294310dd2d404cbd6564df1f498e85c1a Mon Sep 17 00:00:00 2001 From: Caleb Grant Date: Thu, 1 Aug 2024 10:48:20 -0700 Subject: [PATCH] fix nested f-string Signed-off-by: Caleb Grant --- crosstab/crosstab.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crosstab/crosstab.py b/crosstab/crosstab.py index 7a7cbac..a6d07c4 100644 --- a/crosstab/crosstab.py +++ b/crosstab/crosstab.py @@ -243,8 +243,9 @@ def _csv_to_sqlite(self: Crosstab) -> sqlite3.Connection: logger.debug("Creating 'data' table in SQLite database.") with conn: cursor = conn.cursor() + coldef = ", ".join([f'"{col}"' for col in self.csv_columns]) cursor.execute( - f"CREATE TABLE data ({', '.join([f'"{col}"' for col in self.csv_columns])});", + f"CREATE TABLE data ({coldef});", ) cursor.executemany( f"INSERT INTO data VALUES ({', '.join(['?' for _ in self.csv_columns])});",