From a6389d7611bbe2a019bfbe7dc609fae884a213a6 Mon Sep 17 00:00:00 2001 From: Keyna Rafael <95432445+keyn4@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:40:22 -0500 Subject: [PATCH] bump snapshotting coerce_types logic to handle NAN values for integers (#41) --- gluestick/etl_utils.py | 2 ++ setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gluestick/etl_utils.py b/gluestick/etl_utils.py index 2f0d099..390b774 100644 --- a/gluestick/etl_utils.py +++ b/gluestick/etl_utils.py @@ -212,6 +212,8 @@ def snapshot_records( for column, dtype in df_types.items(): if dtype == 'bool': merged_data[column] = merged_data[column].astype('boolean') + elif dtype in ["int64", "int32", "Int32", "Int64"]: + merged_data[column] = merged_data[column].astype("Int64") else: merged_data[column] = merged_data[column].astype(dtype) except Exception as e: diff --git a/setup.py b/setup.py index cabfaaf..f4bede4 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="gluestick", - version="2.1.24", + version="2.1.25", description="ETL utility functions built on Pandas", long_description=long_description, long_description_content_type="text/markdown",