From 20d417160c23294ca6d1ad47d73753d8de39c4df Mon Sep 17 00:00:00 2001 From: Troy Raen Date: Wed, 4 Sep 2024 02:33:33 -0700 Subject: [PATCH] support LVK schema --- pittgoogle/alert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pittgoogle/alert.py b/pittgoogle/alert.py index 1f7bca9..d805b78 100644 --- a/pittgoogle/alert.py +++ b/pittgoogle/alert.py @@ -295,9 +295,9 @@ def dataframe(self) -> "pd.DataFrame": import pandas as pd # always lazy-load pandas. it hogs memory on cloud functions and run # sources and previous sources are expected to have the same fields - sources_df = pd.DataFrame([self.get("source")] + self.get("prv_sources")) + sources_df = pd.DataFrame([self.get("source")] + self.get("prv_sources", [])) # sources and forced sources may have different fields - forced_df = pd.DataFrame(self.get("prv_forced_sources")) + forced_df = pd.DataFrame(self.get("prv_forced_sources", [])) # use nullable integer data type to avoid converting ints to floats # for columns in one dataframe but not the other