location.google_takeout_semantic: handle None visitConfidence

This commit is contained in:
karlicoss 2023-11-10 02:03:20 +00:00
parent f5ec945bce
commit 6d740ddefd

View file

@ -54,8 +54,9 @@ def locations() -> Iterator[Res[Location]]:
for g in events(): for g in events():
if isinstance(g, SemanticLocation): if isinstance(g, SemanticLocation):
if g.visitConfidence < require_confidence: visitConfidence = g.visitConfidence
logger.debug(f"Skipping {g} due to low confidence ({g.visitConfidence}))") if visitConfidence is None or visitConfidence < require_confidence:
logger.debug(f"Skipping {g} due to low confidence ({visitConfidence}))")
continue continue
yield Location( yield Location(
lon=g.lng, lon=g.lng,