Skip to content

Release v1.9.1 - #31

Merged
alex-omophub merged 4 commits into
mainfrom
develop
Sep 7, 2026
Merged

Release v1.9.1#31
alex-omophub merged 4 commits into
mainfrom
develop

Conversation

@alex-omophub

@alex-omophub alex-omophub commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Releases v1.9.1 with SDK updates to match the current API contract. Similarity search now defaults to semantic instead of hybrid, supports pagination and new filters, and autocomplete raises ResponseError instead of silently returning an empty list when the response shape changes.

Search API

  • Similarity search returns pagination from the response envelope and supports page, concept_class_ids, exclude_self, and the semantic default algorithm; metadata now includes totals_are_lower_bound and degraded_from.
  • Autocomplete accepts domain_ids with domains kept as a deprecated alias, models the seven-field suggestion entries, and still accepts the older bare-list response shape.
  • Added ResponseError so an unreadable autocomplete payload is distinguishable from a legitimate empty result.

Mappings

  • Mappings.map() and AsyncMappings.map() now always send include_invalid explicitly, including its False default, and document the unmapped_sources and summary result fields.

Callers who relied on the previous hybrid default algorithm in similarity search will now get semantic results unless they pass algorithm explicitly.

Written for commit 1806df9. Summary will update on new commits.

Review in cubic

alex-omophub added 2 commits September 7, 2026 15:40
- 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

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.10638% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/omophub/resources/search.py 68.18% 7 Missing and 7 partials ⚠️

📢 Thoughts on this report? Let us know!

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread CHANGELOG.md Outdated
Comment thread src/omophub/types/search.py
Comment thread src/omophub/_request.py
)
return self._parse_response(content, status_code, headers)

def post_raw(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment thread README.md
Comment on lines +70 to +71
print(mapped["summary"])
print(mapped["unmapped_sources"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
print(mapped["summary"])
print(mapped["unmapped_sources"])
print(mapped["mapping_summary"])
print(mapped["unmapped_sources"])

alex-omophub added 2 commits September 7, 2026 21:47
- 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.
@alex-omophub
alex-omophub merged commit 547ab35 into main Sep 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant