From cbcd935abe32fedb0ac44b56c305e146d9fbc89f Mon Sep 17 00:00:00 2001 From: Alexander Kozlov Date: Sat, 2 Nov 2024 16:10:18 +0000 Subject: [PATCH] bugfix when existing idx is empty --- datapipe/meta/sql_meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapipe/meta/sql_meta.py b/datapipe/meta/sql_meta.py index 7374226e..db03c0bb 100644 --- a/datapipe/meta/sql_meta.py +++ b/datapipe/meta/sql_meta.py @@ -234,7 +234,7 @@ def get_existing_idx(self, idx: Optional[IndexDF] = None) -> IndexDF: # Empty index -> empty result return cast( IndexDF, - pd.DataFrame(columns=[column.name for column in self.sql_schema]), # type: ignore + pd.DataFrame(columns=self.primary_keys), # type: ignore ) idx_cols = list(set(idx.columns.tolist()) & set(self.primary_keys)) else: