From 6d740ddefd7011349b3aa5d33e58f226d25df441 Mon Sep 17 00:00:00 2001 From: karlicoss Date: Fri, 10 Nov 2023 02:03:20 +0000 Subject: [PATCH] location.google_takeout_semantic: handle None visitConfidence --- my/location/google_takeout_semantic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/my/location/google_takeout_semantic.py b/my/location/google_takeout_semantic.py index fcf7f01..b4f16db 100644 --- a/my/location/google_takeout_semantic.py +++ b/my/location/google_takeout_semantic.py @@ -54,8 +54,9 @@ def locations() -> Iterator[Res[Location]]: for g in events(): if isinstance(g, SemanticLocation): - if g.visitConfidence < require_confidence: - logger.debug(f"Skipping {g} due to low confidence ({g.visitConfidence}))") + visitConfidence = g.visitConfidence + if visitConfidence is None or visitConfidence < require_confidence: + logger.debug(f"Skipping {g} due to low confidence ({visitConfidence}))") continue yield Location( lon=g.lng,