Skip to content

Commit

Permalink
Update astradb.py
Browse files Browse the repository at this point in the history
  • Loading branch information
erichare committed Feb 10, 2025
1 parent be070a7 commit 633e632
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/backend/base/langflow/components/vectorstores/astradb.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ def reset_collection_list(self, build_config: dict):
]

# Reset the selected collection
build_config["collection_name"]["value"] = ""
if build_config["collection_name"]["value"] not in build_config["collection_name"]["options"]:
build_config["collection_name"]["value"] = ""

return build_config

Expand All @@ -508,8 +509,9 @@ def reset_database_list(self, build_config: dict):
]

# Reset the selected database
build_config["database_name"]["value"] = ""
build_config["api_endpoint"]["value"] = ""
if build_config["database_name"]["value"] not in build_config["database_name"]["options"]:
build_config["database_name"]["value"] = ""
build_config["api_endpoint"]["value"] = ""

return build_config

Expand Down Expand Up @@ -569,7 +571,6 @@ def update_build_config(self, build_config: dict, field_value: str, field_name:
# If this is the first execution of the component, reset and build database list
if first_run or field_name in ["token", "environment"]:
# Reset the build config to ensure we are starting fresh
build_config = self.reset_build_config(build_config)
build_config = self.reset_database_list(build_config)

# Get list of regions for a given cloud provider
Expand Down

0 comments on commit 633e632

Please sign in to comment.