-
Notifications
You must be signed in to change notification settings - Fork 6.2k
feat: Update dataframe_operations.py #7713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Update dataframe_operations.py #7713
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds two new operations to the DataFrame Operations component: "Convert to Data List" and "Base64".
- Introduces operations to convert a DataFrame into a list of data objects and to transform a DataFrame into a base64-encoded image.
- Updates imports to include matplotlib and pandas and adjusts the schema import.
Comments suppressed due to low confidence (2)
src/backend/base/langflow/components/processing/dataframe_operations.py:248
- The io module is used but not imported in this file. Please add an import statement for the io module at the top.
buf = io.BytesIO()
src/backend/base/langflow/components/processing/dataframe_operations.py:252
- The base64 module is used to encode the dataframe image but is not imported. Please add an import statement for the base64 module.
base64_image = base64.b64encode(buf.read()).decode("utf-8")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR!
Just a quick note — we are currently limiting the use of DataList, so I’d recommend removing the toDataList option for now until we identify clearer use cases for it.
Also, the DataFrame operations you’re using align well with the standard DF practices, which is great.
Thanks again!
@edwinjosechittilappilly I made a new commit removing the Data List transformation function. Thanks! |
Adding the "Convert to Data List" and "Base64" functions to the DataFrame Operations component.
Use Cases:
Convert to Data List: Useful function to transform a dataframe into a datalist, preparing the data to pass through a loop or other component that does not accept dataframes.
Base64: Transforms the dataframe into a string in base64 format, allowing you to share the dataframe in image format within the Playground and/or any other connected application, including Google Drive, Slack, among others.