Skip to content
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

fix: wrong collection name assignment in ingestion pipeline! #307

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions dags/hivemind_etl_helpers/ingestion_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, community_id: str, collection_name: str, testing: bool = Fals
_, self.embedding_dim = load_model_hyperparams()
self.pg_creds = load_postgres_credentials()
self.redis_cred = load_redis_credentials()
self.collection_name = community_id
self.collection_name = f"{community_id}_{collection_name}"
self.platform_name = collection_name

self.embed_model = (
Expand Down Expand Up @@ -63,8 +63,7 @@ def run_pipeline(self, docs: list[Document]) -> list[BaseNode]:
logging.info(
f"{len(docs)} docuemnts was extracted and now loading into QDrant DB!"
)
qdrant_collection_name = f"{self.collection_name}_{self.platform_name}"
vector_access = QDrantVectorAccess(collection_name=qdrant_collection_name)
vector_access = QDrantVectorAccess(collection_name=self.collection_name)
vector_store = vector_access.setup_qdrant_vector_store()

pipeline = IngestionPipeline(
Expand All @@ -74,13 +73,13 @@ def run_pipeline(self, docs: list[Document]) -> list[BaseNode]:
],
docstore=MongoDocumentStore.from_uri(
uri=get_mongo_uri(),
db_name=f"docstore_{self.collection_name}",
db_name=f"docstore_{self.community_id}",
namespace=self.platform_name,
),
vector_store=vector_store,
cache=IngestionCache(
cache=RedisCache.from_redis_client(self.redis_client),
collection=f"{self.collection_name}_{self.platform_name}_ingestion_cache",
collection=f"{self.collection_name}_ingestion_cache",
docstore_strategy=DocstoreStrategy.UPSERTS,
),
docstore_strategy=DocstoreStrategy.UPSERTS,
Expand Down
Loading