refactor&bugfix: Refactor logging levels and improve CRUD repository … #3
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Refactor Logging and Enhance CRUD Repository with Tests
Summary
This PR introduces key updates to logging levels, CRUD repository methods, and test coverage for the
py_spring_modelmodule. The changes aim to improve logging granularity, enhance method functionality, and provide comprehensive test coverage to ensure code reliability.Changes Made
Logging Improvements:
PySpringModelfrominfotodebugfor better control over verbosity in managed session operations:CRUD Repository Enhancements:
_find_by_querymethod to correctly unpack and return results.delete_all: Uses aSELECTquery to fetch entities for deletion.delete_all_by_ids: Handles entity deletion by ID with a bulk query.Test Suite Addition:
tests/test_crud_repository.py.find_by_id,find_all, andfind_by_query.delete,delete_by_id,delete_all, anddelete_all_by_ids.upsertfunctionality for both existing and new entities.Benefits
How to Test
pytest:pytest tests/test_crud_repository.py