From 032c75fdf4fedbf00cd101cb16f6513785599543 Mon Sep 17 00:00:00 2001 From: "Gergely Daroczi (@daroczig)" Date: Thu, 15 Feb 2024 00:09:46 +0100 Subject: [PATCH] suppress warnings on data read as JSON/dict from DB instead of special obj --- src/sc_crawler/hashing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sc_crawler/hashing.py b/src/sc_crawler/hashing.py index a9218935..88a5eb0d 100644 --- a/src/sc_crawler/hashing.py +++ b/src/sc_crawler/hashing.py @@ -8,7 +8,7 @@ def hashrow(row, ignored=["inserted_at"]): """Return tuple of primary keys and hash of values except for the ignored columns.""" pks = sorted([key.name for key in inspect(row.__class__).primary_key]) - rowdict = row.model_dump() + rowdict = row.model_dump(warnings=False) rowkeys = tuple(rowdict.get(pk) for pk in pks) for dropkey in [*ignored, *pks]: rowdict.pop(dropkey, None)