Closed maheshsattala closed 1 month ago
The changes introduce enhancements to the API for retrieving collection data. The get_collection_data
function now supports multiple filtering keys and values, and a new endpoint, get_collection_data_with_id
, has been added to fetch collection data using a specific collection_id
. Additionally, the CognitionProcessor
class has been updated to accommodate these changes, ensuring robust data retrieval and error handling. New tests have been implemented to validate these functionalities and ensure proper behavior under various conditions.
Files | Change Summary |
---|---|
kairon/api/app/routers/bot/data.py |
Modified get_collection_data to accept lists of keys and values; added get_collection_data_with_id endpoint for fetching data by collection_id . |
kairon/shared/cognition/processor.py |
Added get_collection_data_with_id method to CognitionProcessor ; modified get_collection_data to use lists for keys and values with validation checks. |
tests/integration_test/services_test.py |
Introduced tests for mismatched filter lengths, collection ID retrieval, and expanded existing tests for collection data retrieval. |
tests/unit_test/data_processor/data_processor_test.py |
Added tests for mismatched filter lengths, collection data retrieval with filters, and retrieval by collection_id , including handling of non-existent IDs. |
get_collection_data_with_id
, which is directly related to the changes in the main PR that also adds a new endpoint for fetching collection data based on a specific collection_id
.🐇 In the meadow, data flows,
With keys and values, the rabbit knows.
Collection IDs hop into sight,
Fetching treasures, oh what a delight!
Tests are dancing, ensuring all's right,
In the world of code, we take flight! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Added multiple filters in get API and added test cases related to the same.
Summary by CodeRabbit
New Features
Bug Fixes
Tests