From 440ebca03bbd2a2b7bddaa2ca2f1e456c8f4fcc6 Mon Sep 17 00:00:00 2001 From: MauricioGarciaS <47052044+MauricioGarciaS@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:07:42 +0200 Subject: [PATCH] fix(connectors): small fix of varchar size (#1403) --- ee/connectors/db/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ee/connectors/db/utils.py b/ee/connectors/db/utils.py index cda5232f1..3a7c9c53a 100644 --- a/ee/connectors/db/utils.py +++ b/ee/connectors/db/utils.py @@ -215,11 +215,17 @@ def get_df_from_batch(batch, level): try: if df[x].dtype == "string" or current_types[x] == "string": df[x] = df[x].fillna('NULL') - df[x] = df[x].str.slice(0, 8000) + if x == 'user_id' or x == 'user_anonymous_id': + df[x] = df[x].str.slice(0, 7999) + else: + df[x] = df[x].str.slice(0, 255) df[x] = df[x].str.replace("|", "") except TypeError as e: print(repr(e)) if df[x].dtype == 'str': - df[x] = df[x].str.slice(0, 8000) + if x == 'user_id' or x == 'user_anonymous_id': + df[x] = df[x].str.slice(0, 7999) + else: + df[x] = df[x].str.slice(0, 255) df[x] = df[x].str.replace("|", "") return df