Closed maheshsattala closed 4 days ago
The changes in this pull request enhance the API's functionality for retrieving collection data. The get_collection_data
function now accepts multiple keys and values as lists, improving filtering capabilities. Additionally, a new endpoint, get_collection_data_with_id
, has been introduced to fetch collection data based on a specific collection_id
. The modifications also include extensive testing to ensure robust error handling and validation for these new features.
Files | Change Summary |
---|---|
kairon/api/app/routers/bot/data.py |
- Modified get_collection_data to accept lists of keys and values for flexible filtering.- Added get_collection_data_with_id to retrieve data based on collection_id . |
kairon/shared/cognition/processor.py |
- Added get_collection_data_with_id method to CognitionProcessor for fetching data by collection_id .- Modified get_collection_data to support multiple key-value pairs for filtering. |
tests/integration_test/services_test.py |
- Added tests for various scenarios including mismatched filter lengths, data retrieval by collection ID, and handling of non-existent collection IDs. |
tests/unit_test/data_processor/data_processor_test.py |
- Introduced tests for CognitionDataProcessor covering mismatch filter lengths, filtered data retrieval, and collection ID retrieval, including scenarios for non-existent IDs. |
get_collection_data
function to support multiple keys and values and introduces the get_collection_data_with_id
function, aligning with the enhancements made in the main PR regarding collection data retrieval.In the garden of code, where data does play,
New paths are now forged, brightening the way.
With keys and values, we dance and we twirl,
Fetching collections, watch the data unfurl!
A hop and a skip, let the tests all run free,
For a rabbit's delight is in code's harmony! 🐇✨
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