Why am I getting a "Data too long for column 'code' at row 1" error when adding code to a Python step?

This topic was automatically generated from Slack. You can find the original thread here.

Hi, I’m getting the following error when adding code to a Python step:
Code Error
Mysql2::Error: Data too long for column ‘code’ at row 1

Hi , the error typically is because the column code in your database is too long for your mysql2 library to handle. This error is not from Pipedream, but from the library you use. So I would suggest:

  1. Use another library to connect with your MySQL databse
  2. Or re-model your database, for example, you should store the lengthy text into a file and put it into an object storage (Google Cloud Storage, AWS S3, etc…) instead of storing all into database

I’m not using a SQL database though…?
I’m just reading in data from API’s, transforming them with Pandas, and then sending back to APIs.

could you share the screenshots of action throwing the error? It is really hard for anyone to help for this much information. If you can, please provide as much information as you can

I would just like to confirm that there isn’t a limit on the number of lines of Python allowed in a python step?

Here is a screenshot

There might be a limit of code length on Pipedream. Maybe you can try to shorten your code