Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions open_alaqs/core/interfaces/SQLSerializable.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ def getDatabasePath(self) -> str:

def setEntry(self, key: Any, value_object: dict[str, Any]) -> None:
if self.hasEntry(key):
# Include the table name so callers can trace which SQL
# source is producing duplicate/NULL keys. Without it the
# warning is undiagnosable: any SQLSerializable-derived
# class could be the culprit, and reference tables like
# tbl_InvMeteo can produce hundreds of these per calc run
# if their inferred primary key column is populated with
# NULL. The str(key) cast keeps None showing as 'None' in
# the log rather than raising a formatting error.
logger.warning(
"Already found entry with key '%s'. Replacing existing entry."
% (str(key))
"Already found entry with key '%s' in table '%s'. "
"Replacing existing entry." % (str(key), self._table_name)
)

self._entries[key] = value_object
Expand Down
Loading