mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-03 13:54:55 +03:00
skip None values in filtered output for dot notation
This commit is contained in:
parent
83c10e3647
commit
ee20b0219e
@ -94,9 +94,14 @@ class StatsEmitter(threading.Thread):
|
|||||||
first_value = next(iter(parent.values()), None)
|
first_value = next(iter(parent.values()), None)
|
||||||
|
|
||||||
if isinstance(first_value, dict):
|
if isinstance(first_value, dict):
|
||||||
# Filter each nested entry to only requested fields
|
# Filter each nested entry to only requested fields,
|
||||||
|
# omitting None values to preserve key-absence semantics
|
||||||
selected[parent_key] = {
|
selected[parent_key] = {
|
||||||
entry_key: {field: entry.get(field) for field in child_keys}
|
entry_key: {
|
||||||
|
field: val
|
||||||
|
for field in child_keys
|
||||||
|
if (val := entry.get(field)) is not None
|
||||||
|
}
|
||||||
for entry_key, entry in parent.items()
|
for entry_key, entry in parent.items()
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user