Skip to content

Conversation

@erichare
Copy link
Collaborator

@erichare erichare commented Jun 4, 2025

This pull request renames the output of the split text component, and removes the Data output in favor of dataframe.

Summary by CodeRabbit

  • New Features

    • The "Split Text" component now provides a single output as a DataFrame, streamlining data handling for users.
  • Bug Fixes

    • Updated starter project configuration and tests to ensure compatibility with the new DataFrame output format.
  • Tests

    • Adjusted backend and frontend tests to validate the updated DataFrame output and UI changes.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 4, 2025
@erichare erichare requested a review from rodrigosnader June 4, 2025 03:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 4, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes consolidate the outputs of the SplitTextComponent by removing the separate "Chunks" and "DataFrame" outputs and introducing a single dataframe output that directly returns a DataFrame. Corresponding updates are made to tests and the Vector Store RAG starter project configuration to align with this new interface.

Changes

File(s) Change Summary
src/backend/base/langflow/components/processing/split_text.py Merged "chunks" and "dataframe" outputs into a single "dataframe" output; split_text now returns a DataFrame; removed as_dataframe.
src/backend/tests/unit/components/processing/test_split_text_component.py Updated tests to expect DataFrame output from split_text; adjusted assertions and removed redundant test.
src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json Updated "Split Text" component: consolidated outputs, changed output type to DataFrame, updated method signatures, and outputs metadata.
src/frontend/tests/core/features/filterSidebar.spec.ts Changed UI test to check for "processingData Operations" element instead of "processingSplit Text".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SplitTextComponent

    User->>SplitTextComponent: Call split_text()
    SplitTextComponent->>SplitTextComponent: Process and split documents
    SplitTextComponent->>SplitTextComponent: Convert to Data objects
    SplitTextComponent->>SplitTextComponent: Construct DataFrame from Data objects
    SplitTextComponent-->>User: Return DataFrame
Loading

Suggested labels

size:S

Suggested reviewers

  • edwinjosechittilappilly

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@erichare erichare requested a review from Yukiyukiyeah June 4, 2025 03:08
@github-actions github-actions bot added the bug Something isn't working label Jun 4, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/backend/base/langflow/components/processing/split_text.py (1)

134-135: Add missing docstring for the split_text method.

The implementation correctly returns a DataFrame by wrapping the result of _docs_to_data(self.split_text_base()). However, the method is missing a docstring as flagged by the static analysis tool.

+    def split_text(self) -> DataFrame:
+        """Split the input text into chunks and return as a DataFrame.
+        
+        Returns:
+            DataFrame: A DataFrame containing the text chunks with metadata.
+        """
-    def split_text(self) -> DataFrame:
         return DataFrame(self._docs_to_data(self.split_text_base()))
🧰 Tools
🪛 Pylint (3.3.7)

[convention] 134-134: Missing function or method docstring

(C0116)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9aaca68 and cf45d52.

📒 Files selected for processing (2)
  • src/backend/base/langflow/components/processing/split_text.py (2 hunks)
  • src/backend/tests/unit/components/processing/test_split_text_component.py (9 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/backend/tests/unit/components/processing/test_split_text_component.py (2)
src/backend/base/langflow/components/processing/split_text.py (2)
  • split_text (134-135)
  • SplitTextComponent (9-135)
src/backend/base/langflow/schema/dataframe.py (1)
  • DataFrame (11-206)
🪛 Pylint (3.3.7)
src/backend/tests/unit/components/processing/test_split_text_component.py

[convention] 58-58: Line too long (113/100)

(C0301)


[convention] 88-88: Line too long (113/100)

(C0301)


[convention] 118-118: Line too long (113/100)

(C0301)


[convention] 200-200: Line too long (101/100)

(C0301)


[convention] 220-220: Line too long (103/100)

(C0301)


[convention] 221-221: Line too long (105/100)

(C0301)


[convention] 222-222: Line too long (107/100)

(C0301)


[convention] 223-223: Line too long (107/100)

(C0301)


[convention] 244-244: Line too long (103/100)

(C0301)


[convention] 245-245: Line too long (105/100)

(C0301)


[convention] 246-246: Line too long (107/100)

(C0301)


[convention] 247-247: Line too long (107/100)

(C0301)

src/backend/base/langflow/components/processing/split_text.py

[convention] 134-134: Missing function or method docstring

(C0116)

🔇 Additional comments (6)
src/backend/base/langflow/components/processing/split_text.py (1)

66-66: LGTM! Output consolidation aligns with PR objectives.

The change to a single DataFrame output named "dataframe" properly consolidates the previous separate outputs as intended by the PR.

src/backend/tests/unit/components/processing/test_split_text_component.py (5)

55-67: Excellent test updates for DataFrame interface validation.

The test correctly verifies the new DataFrame output interface:

  • Proper type assertion for DataFrame
  • Row count validation using len(data_frame)
  • Column structure verification
  • DataFrame indexing with .iloc[0]["text"] for accessing chunk content

These changes properly validate the consolidated output format.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 58-58: Line too long (113/100)

(C0301)


155-162: Well-implemented metadata preservation test.

The test correctly uses data_frame.iterrows() to iterate over DataFrame rows and validates that metadata is preserved in each chunk. This is the proper way to access row data in a DataFrame.


200-200: Consistent DataFrame column access pattern.

The test properly uses results["text"][0] to access the text column data directly, which is an efficient way to access DataFrame column values.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 200-200: Line too long (101/100)

(C0301)


220-223: Proper DataFrame access for multiple inputs test.

The test correctly validates multiple text inputs by accessing the DataFrame columns directly with results["text"][index] pattern, ensuring all chunks are properly created and accessible.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 220-220: Line too long (103/100)

(C0301)


[convention] 221-221: Line too long (105/100)

(C0301)


[convention] 222-222: Line too long (107/100)

(C0301)


[convention] 223-223: Line too long (107/100)

(C0301)


269-269: Correct DataFrame type assertion for URL loader integration.

The test properly verifies that the split_text method returns a DataFrame when working with URL loader output, ensuring the integration works with the new consolidated interface.

@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json (1)

879-879: Embedded component code updated correctly.

The JSON-embedded Python block for SplitTextComponent now reflects the single dataframe output via split_text, with no lingering as_dataframe or list-based outputs. Ensure that the JSON string literal uses proper escaping to remain valid.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf45d52 and 275b07c.

📒 Files selected for processing (2)
  • src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Run Ruff Check and Format
  • GitHub Check: Optimize new Python code in this PR
  • GitHub Check: Update Starter Projects
  • GitHub Check: Ruff Style Check (3.13)
🔇 Additional comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json (1)

925-925: Formatting-only change detected

This JSON configuration shows a re-serialization/formatting update with no semantic modifications to the APIRequestComponent. No action is needed.

Comment on lines 152 to 156
"dataType": "SplitText",
"id": "SplitText-aHhAi",
"name": "chunks",
"output_types": [
"Data"
]
"output_types": []
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Align output handle metadata with refactored component.

The "name": "chunks" and empty "output_types": [] must be updated to match the new output alias and type, i.e.:

-            "name": "chunks",
-            "output_types": []
+            "name": "dataframe",
+            "output_types": ["DataFrame"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dataType": "SplitText",
"id": "SplitText-aHhAi",
"name": "chunks",
"output_types": [
"Data"
]
"output_types": []
},
"dataType": "SplitText",
"id": "SplitText-aHhAi",
"name": "dataframe",
"output_types": ["DataFrame"]
},
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Vector Store
RAG.json around lines 152 to 156, update the "name" and "output_types" fields in
the output handle metadata to match the refactored component's new output alias
and type. Replace "name": "chunks" with the new output alias and set
"output_types" to the correct array reflecting the new output type.

Comment on lines 167 to 171
"id": "reactflow__edge-SplitText-aHhAi{œdataTypeœ:œSplitTextœ,œidœ:œSplitText-aHhAiœ,œnameœ:œchunksœ,œoutput_typesœ:[œDataœ]}-AstraDB-lXzoG{œfieldNameœ:œingest_dataœ,œidœ:œAstraDB-lXzoGœ,œinputTypesœ:[œDataœ,œDataFrameœ],œtypeœ:œotherœ}",
"selected": false,
"source": "SplitText-aHhAi",
"sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-aHhAiœ, œnameœ: œchunksœ, œoutput_typesœ: [œDataœ]}",
"sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-aHhAiœ, œnameœ: œchunksœ, œoutput_typesœ: []}",
"target": "AstraDB-lXzoG",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update edge sourceHandle to new output handle.

The JSON-encoded sourceHandle still references "name": "chunks" and an empty output_types. It should reflect the new handle:

-        "sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-aHhAiœ, œnameœ: œchunksœ, œoutput_typesœ: []}"
+        "sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-aHhAiœ, œnameœ: œdataframeœ, œoutput_typesœ: [œDataFrameœ]}"

so that the starter project wires into the DataFrame output correctly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"id": "reactflow__edge-SplitText-aHhAi{œdataTypeœ:œSplitTextœ,œidœ:œSplitText-aHhAiœ,œnameœ:œchunksœ,œoutput_typesœ:[œDataœ]}-AstraDB-lXzoG{œfieldNameœ:œingest_dataœ,œidœ:œAstraDB-lXzoGœ,œinputTypesœ:[œDataœ,œDataFrameœ],œtypeœ:œotherœ}",
"selected": false,
"source": "SplitText-aHhAi",
"sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-aHhAiœ, œnameœ: œchunksœ, œoutput_typesœ: [œDataœ]}",
"sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-aHhAiœ, œnameœ: œchunksœ, œoutput_typesœ: []}",
"target": "AstraDB-lXzoG",
"id": "reactflow__edge-SplitText-aHhAi{œdataTypeœ:œSplitTextœ,œidœ:œSplitText-aHhAiœ,œnameœ:œchunksœ,œoutput_typesœ:[œDataœ]}-AstraDB-lXzoG{œfieldNameœ:œingest_dataœ,œidœ:œAstraDB-lXzoGœ,œinputTypesœ:[œDataœ,œDataFrameœ],œtypeœ:œotherœ}",
"selected": false,
"source": "SplitText-aHhAi",
"sourceHandle": "{œdataTypeœ: œSplitTextœ, œidœ: œSplitText-aHhAiœ, œnameœ: œdataframeœ, œoutput_typesœ: [œDataFrameœ]}",
"target": "AstraDB-lXzoG",
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Vector Store
RAG.json around lines 167 to 171, the edge's sourceHandle field still references
the old output handle with "name": "chunks" and an empty output_types array.
Update the sourceHandle to reflect the new output handle by changing the "name"
to the correct new output name and setting the "output_types" to include
"DataFrame" so that the wiring correctly connects to the DataFrame output.

@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@erichare erichare requested review from Yukiyukiyeah and edwinjosechittilappilly and removed request for Yukiyukiyeah June 4, 2025 16:56
Copy link
Collaborator

@Yukiyukiyeah Yukiyukiyeah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 4, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 9, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 9, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 9, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 10, 2025
@erichare erichare enabled auto-merge June 10, 2025 17:30
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 10, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jun 10, 2025
@erichare erichare added this pull request to the merge queue Jun 10, 2025
Merged via the queue into main with commit e5e54ea Jun 10, 2025
107 of 108 checks passed
@erichare erichare deleted the fix-split-text branch June 10, 2025 19:35
dev-thiago-oliver pushed a commit to vvidai/langflow that referenced this pull request Jun 10, 2025
* fix: Split text should only have dataframe output

* [autofix.ci] apply automated fixes

* Update templates

* test fix

* Update Vector Store RAG.json

* Update starter projects

* fix tests

* add shards

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <[email protected]>
Co-authored-by: cristhianzl <[email protected]>
ogabrielluiz pushed a commit to bkatya2001/langflow that referenced this pull request Jun 24, 2025
* fix: Split text should only have dataframe output

* [autofix.ci] apply automated fixes

* Update templates

* test fix

* Update Vector Store RAG.json

* Update starter projects

* fix tests

* add shards

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <[email protected]>
Co-authored-by: cristhianzl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants