在将Python数据帧写入AWS红移时,DataError-值对于类型字符变化(256)而言太长

时间:2018-05-07 16:10:19

标签: python-3.x pandas amazon-redshift

我正在尝试将Python数据框写入redshift。我写了这段代码 -

df.to_sql('df', redshiftEngine, index = False, if_exists = 'replace')
redshiftENgine = create_engine('skipping the details')

我收到以下错误:

DataError: value too long for type character varying(256)

进一步深入研究sqalchemy文档,我发现了这个:

Exception raised for errors that are due to problems with the processed data like division by zero, numeric value out of range, etc.This error is a DBAPI Error and originates from the database driver (DBAPI), not SQLAlchemy itself.

但我仍然不确定如何处理这个错误。我有300多列和3000多行。

以前有人遇到过这个吗?

0 个答案:

没有答案