Skip to content

Conversation

@srini047
Copy link
Contributor

@srini047 srini047 commented Oct 6, 2025

Related Issues

Proposed Changes:

  • Added support for delete_all_documents() in document_stort and client
  • Removed the delete_all from the delete() to decouple
  • Some generic cleanup of the integration

How did you test it?

  • Run complete integration test for Astra integration
cd integrations/astra
hatch run test:integration
  • Make use of delete_all_documents() where delete(delete_all=True) was used earlier

Notes for the reviewer

A quick question: This is a breaking change do we still need the backward compatibility?

Checklist

@srini047 srini047 requested a review from a team as a code owner October 6, 2025 16:58
@srini047 srini047 requested review from mpangrazzi and removed request for a team October 6, 2025 16:58
@github-actions github-actions bot added integration:astra type:documentation Improvements or additions to documentation labels Oct 6, 2025
@srini047 srini047 force-pushed the delete-all-astra-ds branch from a8f1f67 to 823b2ad Compare October 6, 2025 17:05
@srini047 srini047 force-pushed the delete-all-astra-ds branch from 823b2ad to 81c288b Compare October 6, 2025 17:06
Copy link
Contributor

@mpangrazzi mpangrazzi left a comment

Choose a reason for hiding this comment

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

Thanks for your work! I left some comments.

In addition, I see there is no error handling logic here, i.e. no try / catch login if delete_all_documents fails. Please have a look at other implementation and update tests / PR.

Comment on lines 429 to 432
if deletion_counter == -1:
logger.info("All documents deleted")
else:
logger.info("Could not delete all documents")
Copy link
Contributor

Choose a reason for hiding this comment

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

This logging logic can be improved. What about removing this in favour of something like:

logger.info(f"{deletion_counter} documents deleted")

Copy link
Contributor Author

@srini047 srini047 Oct 9, 2025

Choose a reason for hiding this comment

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

@mpangrazzi The reason for this if-else was -1 which is the response provided by Astra client for successful delete all documents. But in general for a user mindset -1 would mean a error code. Hence I wanted to give a message instead of a counter value returned by Astra.

Copy link
Contributor

Choose a reason for hiding this comment

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

@srini047 Got it! So in this case I would do a better error handling: logging it with proper level (i.e. error), get the message (is it available somewhere?). WDYT?

Copy link
Contributor Author

@srini047 srini047 Oct 14, 2025

Choose a reason for hiding this comment

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

@mpangrazzi This is the response from the Astra API. There's something called raw_result attribute but don't think it has a definite string/msg that we can parse and notify the user with actual error.

We should be handling it from our end but anyways don't have enough data to share with users. So I think this should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just changed the verbosity level.

@srini047 srini047 force-pushed the delete-all-astra-ds branch from 6ecc890 to a27a50c Compare October 9, 2025 17:43
@srini047 srini047 force-pushed the delete-all-astra-ds branch from a27a50c to 28e6fad Compare October 11, 2025 10:01
@srini047 srini047 requested a review from mpangrazzi October 11, 2025 10:09
@srini047 srini047 changed the title feat: add support for delete_all_documents for astra client feat: add support for delete_all_documents for astra client Oct 15, 2025
Copy link
Contributor

@mpangrazzi mpangrazzi left a comment

Choose a reason for hiding this comment

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

LGTM!

@mpangrazzi mpangrazzi merged commit e4c12d1 into deepset-ai:main Oct 21, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:astra type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add delete_all_documents() operation to AstraDocumentStore

2 participants