Skip to content

Conversation

edwinjosechittilappilly
Copy link
Collaborator

This pull request includes significant changes to the AstraDBCQLToolComponent class in the src/backend/base/langflow/components/tools/astradb_cql.py file. The changes involve refactoring the component class, modifying input types, and adding new methods for output handling.

Refactoring and input modifications:

  • Replaced StrInput with MessageTextInput for several input fields, such as keyspace, table_name, api_endpoint, and projection_fields. [1] [2]
  • Added the tool_mode attribute to DictInput fields partition_keys and clustering_keys.

Output handling and method additions:

  • Introduced outputs attribute with Output definitions for api_run_model and api_as_dataframe.
  • Added as_dataframe method to convert results into a DataFrame.

Code removal:

  • Removed methods create_args_schema and build_tool, which were responsible for schema creation and tool building.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Mar 12, 2025
@edwinjosechittilappilly edwinjosechittilappilly added DO NOT MERGE Don't Merge this PR breaking change and removed enhancement New feature or request labels Mar 12, 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 refactors the AstraDBCQLToolComponent to support tool mode, enhancing input and output handling for Astra DB CQL operations. Key changes include replacing StrInput with MessageTextInput, adding the tool_mode flag to key inputs, and introducing an as_dataframe method for converting REST output into a DataFrame while removing deprecated schema creation and tool building methods.


def as_dataframe(self, **args) -> DataFrame:
results = self.astra_rest(args)
results = self.astra_rest(args)
Copy link
Preview

Copilot AI Mar 12, 2025

Choose a reason for hiding this comment

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

The as_dataframe method calls self.astra_rest(args) twice, which appears to be a duplicate call. Consider removing one of these calls to avoid unnecessary execution.

Suggested change
results = self.astra_rest(args)

Copilot uses AI. Check for mistakes.

@github-actions github-actions bot added the enhancement New feature or request label Mar 12, 2025
@edwinjosechittilappilly
Copy link
Collaborator Author

@carlosrcoelho we might need a code owner to test this tool

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 12, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 12, 2025
@edwinjosechittilappilly edwinjosechittilappilly marked this pull request as draft April 28, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change DO NOT MERGE Don't Merge this PR enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant