Skip to content

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Empreiteiro
Copy link

@Empreiteiro Empreiteiro commented Apr 18, 2025

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.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Apr 18, 2025
@Empreiteiro Empreiteiro changed the title Update dataframe_operations.py feat: Update dataframe_operations.py Apr 18, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 18, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Apr 22, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 22, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 22, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 24, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 24, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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")

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 30, 2025
Copy link
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a 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!

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 30, 2025
@Empreiteiro
Copy link
Author

@edwinjosechittilappilly I made a new commit removing the Data List transformation function. Thanks!

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 30, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants