Skip to content

Commit

Permalink
changed articles_to_update_query name to articles_to_update
Browse files Browse the repository at this point in the history
  • Loading branch information
henri123lemoine committed Aug 29, 2023
1 parent ccefe52 commit a40207d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions align_data/embeddings/pinecone/update_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ def update(self, custom_sources: List[str], force_update: bool = False):
:param custom_sources: List of sources to update.
"""
with make_session() as session:
articles_to_update_query = get_pinecone_articles_by_sources(
articles_to_update = get_pinecone_articles_by_sources(
session, custom_sources, force_update
)
for batch in self.batch_entries(articles_to_update_query):
for batch in self.batch_entries(articles_to_update):
self.save_batch(session, batch)

def update_articles_by_ids(
self, custom_sources: List[str], hash_ids: List[int], force_update: bool = False
):
"""Update the Pinecone entries of specific articles based on their hash_ids."""
with make_session() as session:
articles_to_update_query = get_pinecone_articles_by_ids(
articles_to_update = get_pinecone_articles_by_ids(
session, hash_ids, custom_sources, force_update
)
for batch in self.batch_entries(articles_to_update_query):
for batch in self.batch_entries(articles_to_update):
self.save_batch(session, batch)

def save_batch(self, session: Session, batch: List[Tuple[Article, PineconeEntry]]):
Expand Down

0 comments on commit a40207d

Please sign in to comment.