[OSDEV-1346] Remove null properties from OpenSearch output#417
Conversation
React App | Jest test suite - Code coverage reportTotal: 27.8%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
src/django/api/serializers/v1/opensearch_common_validators/search_after_validator.py (2)
1-5: Add type hints and documentationConsider adding:
- Type hint for the
dataparameter in the interface method- Class-level docstring explaining the validator's purpose and expected input format
from typing import List from api.serializers.v1.opensearch_validation_interface \ import OpenSearchValidationInterface class SearchAfterValidator(OpenSearchValidationInterface): + """ + Validates the search_after parameter in OpenSearch queries. + The search_after parameter must contain exactly two comma-separated values. + """
1-23: Consider adding unit tests and documentationAs this validator is part of the OpenSearch integration:
- Add comprehensive unit tests covering various input scenarios
- Document the expected format of search_after values in the API documentation
- Consider adding examples in the docstring showing valid and invalid inputs
Would you like me to help generate a test suite for this validator?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
src/django/api/serializers/v1/moderation_event_update_serializer.py(1 hunks)src/django/api/serializers/v1/opensearch_common_validators/search_after_validator.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/django/api/serializers/v1/moderation_event_update_serializer.py
src/django/api/serializers/v1/opensearch_common_validators/search_after_validator.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
doc/release/RELEASE-NOTES.md (2)
23-24: Enhance the OpenSearch null value handling descriptionThe current description "Disabled null values from the response of the OpenSearch" is too vague. Consider providing more details about:
- Which specific fields are affected
- The rationale behind this change
- Any potential impact on API consumers
-* [OSDEV-1346](https://opensupplyhub.atlassian.net/browse/OSDEV-1346) - Create GET request for `v1/moderation-events` endpoint. Disabled null values from the response of the OpenSearch. Disabled possible null `os_id`, `claim_id` and `source` from PATCH response. +* [OSDEV-1346](https://opensupplyhub.atlassian.net/browse/OSDEV-1346) - Create GET request for `v1/moderation-events` endpoint. Enhanced OpenSearch response by removing null values to improve data quality and reduce payload size. Specifically removed null values for `os_id`, `claim_id` and `source` fields from PATCH response to ensure consistent data representation.
Line range hint
8-10: Document migration impact and rollback proceduresThe database migrations section should include:
- Impact assessment of each migration
- Any required downtime
- Rollback procedures if needed
#### Migrations: -* 0159_alter_status_of_moderation_events_table.py - This migration alters status of api_moderationevent table. -* 0160_allow_null_parsing_errors_in_facilitylist.py - This migration allows empty parsing_errors in api_facilitylist. +#### Migrations: +* 0159_alter_status_of_moderation_events_table.py + - Impact: Modifies status options in api_moderationevent table + - Downtime: None required + - Rollback: Revertible via standard Django migration + +* 0160_allow_null_parsing_errors_in_facilitylist.py + - Impact: Enables empty parsing_errors in api_facilitylist + - Downtime: None required + - Rollback: Revertible via standard Django migration
|



Follow-up PR to OSDEV-1346.
Disable null values from the response of the OpenSearch.
Disable possible null
os_id,claim_idandsourcefrom PATCH response.