From 403ed06ecc82d9970023624c86c5c076183d5e58 Mon Sep 17 00:00:00 2001 From: Reed Foster Date: Sat, 17 Aug 2024 11:51:15 -0400 Subject: [PATCH 1/2] fix naming of db connection --- src/qnnpy/functions/functions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qnnpy/functions/functions.py b/src/qnnpy/functions/functions.py index 39e291b..22201cb 100644 --- a/src/qnnpy/functions/functions.py +++ b/src/qnnpy/functions/functions.py @@ -713,14 +713,14 @@ def database_connection(**kwargs) -> Connection: def log_data_to_database(table_name: str, connection=None, **kwargs): if connection is None: - conn = database_connection() - cur = conn.cursor() + connection = database_connection() + cur = connection.cursor() column_names = "`" + "`, `".join(kwargs.keys()) + "`" values = "'" + "', '".join([str(v) for v in kwargs.values()]) + "'" command = "INSERT INTO `%s` (%s) VALUES (%s)" % (table_name, column_names, values) cur.execute(command) - conn.commit() - conn.close() + connection.commit() + connection.close() def update_table( From 0e0178ea250100a9e4496a7c1472cdd0d6bc4cda Mon Sep 17 00:00:00 2001 From: Reed Foster Date: Sat, 17 Aug 2024 11:51:45 -0400 Subject: [PATCH 2/2] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8ce4a2a..7027b38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ build-backend = "pdm.backend" [project] name = "qnnpy" -version = "0.1.15" +version = "0.1.16" authors = [ { name="O. Medeiros", email="omedeiro@mit.edu" },