Release v1.9.1 - #31
Conversation
- Updated the README to clarify the usage of the `similar` method, including default algorithm behavior. - Introduced a new `ResponseError` exception to handle unreadable API responses, ensuring protocol drift is distinguishable from empty results. - Enhanced the `autocomplete` method to support both new and legacy response formats, improving backward compatibility. - Added pagination support to the similarity search results, allowing users to navigate through large datasets effectively. - Updated unit tests to cover new error handling and response formats, ensuring robust functionality.
…ation - Added pagination and comprehensive filtering options to the similarity search, improving data retrieval capabilities. - Enhanced `ResponseError` to better differentiate between unreadable responses and legitimate empty results. - Updated `include_invalid` parameter handling in `Mappings.map()` and `AsyncMappings.map()` to ensure explicit defaults are sent, with improved documentation on mapping results. - Revised README to include examples for mapping native codes and handling unmapped sources. - Updated unit tests to validate new features and ensure correct behavior of the API.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
2 issues found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/omophub/_request.py">
<violation number="1" location="src/omophub/_request.py:178">
P3: The new public `post_raw` methods (sync and async) have no unit tests, while the parallel `get_raw` methods have full coverage (success, params, error, rate-limit, invalid-JSON) and `post` has its own test. `post_raw` is now a dependency of `resources/search.py` pagination, so a regression in raw-response handling would go undetected. Add sync and async `post_raw` tests mirroring the `get_raw`/`post` cases.</violation>
</file>
<file name="README.md">
<violation number="1" location="README.md:70">
P3: The README example indexes `mapped["summary"]`, but the repo's own example for the same `client.mappings.map()` method (`examples/map_between_vocabularies.py`) reads `result.get("mapping_summary", {})`. `map()` returns the raw API `data` unmodified, so only one key name is correct; if the API field is `mapping_summary`, the README's `mapped["summary"]` raises a KeyError. Align the README with the actual response key (or confirm which is right and fix the other).</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| ) | ||
| return self._parse_response(content, status_code, headers) | ||
|
|
||
| def post_raw( |
There was a problem hiding this comment.
P3: The new public post_raw methods (sync and async) have no unit tests, while the parallel get_raw methods have full coverage (success, params, error, rate-limit, invalid-JSON) and post has its own test. post_raw is now a dependency of resources/search.py pagination, so a regression in raw-response handling would go undetected. Add sync and async post_raw tests mirroring the get_raw/post cases.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/omophub/_request.py, line 178:
<comment>The new public `post_raw` methods (sync and async) have no unit tests, while the parallel `get_raw` methods have full coverage (success, params, error, rate-limit, invalid-JSON) and `post` has its own test. `post_raw` is now a dependency of `resources/search.py` pagination, so a regression in raw-response handling would go undetected. Add sync and async `post_raw` tests mirroring the `get_raw`/`post` cases.</comment>
<file context>
@@ -175,6 +175,29 @@ def post(
)
return self._parse_response(content, status_code, headers)
+ def post_raw(
+ self,
+ path: str,
</file context>
| print(mapped["summary"]) | ||
| print(mapped["unmapped_sources"]) |
There was a problem hiding this comment.
P3: The README example indexes mapped["summary"], but the repo's own example for the same client.mappings.map() method (examples/map_between_vocabularies.py) reads result.get("mapping_summary", {}). map() returns the raw API data unmodified, so only one key name is correct; if the API field is mapping_summary, the README's mapped["summary"] raises a KeyError. Align the README with the actual response key (or confirm which is right and fix the other).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 70:
<comment>The README example indexes `mapped["summary"]`, but the repo's own example for the same `client.mappings.map()` method (`examples/map_between_vocabularies.py`) reads `result.get("mapping_summary", {})`. `map()` returns the raw API `data` unmodified, so only one key name is correct; if the API field is `mapping_summary`, the README's `mapped["summary"]` raises a KeyError. Align the README with the actual response key (or confirm which is right and fix the other).</comment>
<file context>
@@ -61,6 +61,15 @@ for c in results["concepts"]:
+ "SNOMED",
+ source_codes=[{"vocabulary_id": "ICD10CM", "concept_code": "E11.9"}],
+)
+print(mapped["summary"])
+print(mapped["unmapped_sources"])
+
</file context>
| print(mapped["summary"]) | |
| print(mapped["unmapped_sources"]) | |
| print(mapped["mapping_summary"]) | |
| print(mapped["unmapped_sources"]) |
- Updated the mapping summary retrieval in `map_concepts()` to use the correct key, improving output clarity. - Enhanced the `Suggestion` TypedDict to allow optional enriched concept metadata, providing more flexibility in autocomplete suggestions. - Added comprehensive unit tests for the `post_raw` method in both synchronous and asynchronous request handlers, ensuring robust error handling and response validation.
Summary by cubic
Releases v1.9.1 with SDK updates to match the current API contract. Similarity search now defaults to
semanticinstead ofhybrid, supports pagination and new filters, and autocomplete raisesResponseErrorinstead of silently returning an empty list when the response shape changes.Search API
page,concept_class_ids,exclude_self, and thesemanticdefault algorithm; metadata now includestotals_are_lower_boundanddegraded_from.domain_idswithdomainskept as a deprecated alias, models the seven-field suggestion entries, and still accepts the older bare-list response shape.ResponseErrorso an unreadable autocomplete payload is distinguishable from a legitimate empty result.Mappings
Mappings.map()andAsyncMappings.map()now always sendinclude_invalidexplicitly, including itsFalsedefault, and document theunmapped_sourcesandsummaryresult fields.Callers who relied on the previous
hybriddefault algorithm in similarity search will now getsemanticresults unless they passalgorithmexplicitly.Written for commit 1806df9. Summary will update on new commits.