From 5590acbb7fc82e689b18f3f9d12dee27447cd5b3 Mon Sep 17 00:00:00 2001 From: Raquel Smith Date: Thu, 21 Dec 2023 08:49:05 -0800 Subject: [PATCH] fix: rows synced doesn't exist (#19469) * fix rows synced doesn't exist * use default value --- ee/billing/quota_limiting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/billing/quota_limiting.py b/ee/billing/quota_limiting.py index ef3e12a421575..0809266b1db64 100644 --- a/ee/billing/quota_limiting.py +++ b/ee/billing/quota_limiting.py @@ -147,12 +147,12 @@ def set_org_usage_summary( new_usage = copy.deepcopy(new_usage) for field in ["events", "recordings", "rows_synced"]: - resource_usage = new_usage[field] # type: ignore + resource_usage = new_usage.get(field, {"limit": None, "usage": 0, "todays_usage": 0}) if not resource_usage: continue if todays_usage: - resource_usage["todays_usage"] = todays_usage[field] # type: ignore + resource_usage["todays_usage"] = todays_usage.get(field, 0) else: # TRICKY: If we are not explictly setting todays_usage, we want to reset it to 0 IF the incoming new_usage is different if (organization.usage or {}).get(field, {}).get("usage") != resource_usage.get("usage"):