location.google_takeout_semantic: handle None visitConfidence

This commit is contained in:
karlicoss 2023-11-10 02:03:20 +00:00
parent 65c617ed94
commit 70bb9ed0c5

View file

@ -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,