fix(connectors): small fix of varchar size (#1403)

This commit is contained in:
MauricioGarciaS 2023-07-11 15:07:42 +02:00 committed by GitHub
parent a2968e8cc5
commit 440ebca03b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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