From 98f2223d0b919d3f7b6aca2c8ec84117a2c98b8b Mon Sep 17 00:00:00 2001 From: "Maurice (mausy5043) Hendrix" Date: Wed, 5 Oct 2022 12:40:01 +0200 Subject: [PATCH] fix "SyntaxWarning: "is" with a literal..." --- pyproject.toml | 2 +- src/mausy5043_common/libsqlite3.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c7a53f1..c63d954 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ build-backend = "hatchling.build" [project] name = "mausy5043-common" -version = "1.0.1" +version = "1.0.2" dependencies = [ "numpy", "pandas", diff --git a/src/mausy5043_common/libsqlite3.py b/src/mausy5043_common/libsqlite3.py index 5020be4..0ac7e6f 100755 --- a/src/mausy5043_common/libsqlite3.py +++ b/src/mausy5043_common/libsqlite3.py @@ -10,7 +10,7 @@ import pandas as pd -import funfile as mf +from . import funfile as mf class SqlDatabase: @@ -112,10 +112,10 @@ def insert(self, method='ignore', index='sample_time'): except s3.IntegrityError: # probably "sqlite3.IntegrityError: UNIQUE constraint failed". # this can be passed - if method is 'ignore': + if method == 'ignore': mf.syslog_trace("Duplicate entry. Not adding to database.", False, self.debug) pass - if method is 'replace': + if method == 'replace': element_time = element[f'{df_idx}'] sql_command = f'DELETE FROM {self.table} WHERE sample_time = "{element_time}";' # mf.syslog_trace(f"{sql_command}", False, self.debug)