Conversation
…)` for synonyms and relationships, and update User-Agent header format.
…ters with pagination
…sts. Updated synchronous and asynchronous client tests to use monkeypatching for API key checks. Added new tests for handling raw requests, including error parsing, rate limits, and JSON decoding issues.
…nd client configurations.
…s and integration tests - Introduced `semantic` and `similar` search methods in the search resource, allowing for advanced concept searches using neural embeddings and similarity algorithms. - Added new TypedDicts for `SemanticSearchResult`, `SemanticSearchMeta`, `SimilarConcept`, and `SimilarSearchResult` to structure the response data. - Implemented integration tests for semantic search, including filtering and pagination, as well as tests for finding similar concepts by ID and name. - Updated type imports and ensured compatibility with existing search functionality.
- Updated README example to reflect changes in the results structure for semantic search. - Refactored integration tests to utilize a new `extract_data` function for consistent handling of results and similar concepts, improving code clarity and maintainability.
Semantic search
…improved filtering accuracy.
…onds for improved test reliability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ntImpl - Implemented retry mechanism for handling server errors (502, 503, 504) in both synchronous and asynchronous HTTP clients. - Added exponential backoff delay for retries to improve resilience against temporary server issues.
Add retry logic for server errors
- Introduced `bulk_basic` and `bulk_semantic` methods for executing multiple lexical and semantic searches in a single API call, respectively. - Updated the README to include examples for bulk search usage. - Added corresponding types for bulk search inputs and responses in the type definitions. - Implemented integration and unit tests to validate the new bulk search features.
- Added new types for bulk search and semantic search functionalities to the `__all__` exports in `__init__.py`. - Removed previously commented sections for clarity and organization.
- Updated assertions in `test_bulk_basic_search` to verify that all expected search IDs are present in the results. - Added a check in `test_bulk_semantic_search` to confirm that the SNOMED vocabulary filter is applied to the results.
Add bulk search functionality to the API
- Upgraded `actions/checkout` from v4 to v6 in both `ci.yml` and `publish.yml`. - Updated `codecov/codecov-action` from v4 to v5 in `ci.yml`. - Changed `actions/upload-artifact` and `actions/download-artifact` from v4 to v5 in `publish.yml`.
…nd server errors (#6) - Introduced a new `_calculate_retry_delay` function to handle retry delays based on the Retry-After header and exponential backoff with jitter. - Updated `SyncHTTPClient` and `AsyncHTTPClientImpl` to utilize the new retry delay calculation for handling rate limits (429) and server errors (502, 503, 504). - Enhanced retry mechanism to improve resilience against temporary issues. Co-authored-by: alex-omophub <sdk@omophub.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
5 issues found across 43 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="CHANGELOG.md">
<violation number="1" location="CHANGELOG.md:8">
P3: Add link definitions for the new `[1.5.1]` and `[1.5.0]` changelog sections so those headings resolve correctly.</violation>
<violation number="2" location="CHANGELOG.md:120">
P2: Update the `[Unreleased]` compare link to start from `v1.5.1` (latest release), not `v1.4.1`.</violation>
</file>
<file name="CONTRIBUTING.md">
<violation number="1" location="CONTRIBUTING.md:56">
P2: The documented Python prerequisite is too low for this project. Update it to match the actual supported version (`>=3.10`) to avoid setup failures for contributors using 3.9.</violation>
</file>
<file name="src/omophub/_request.py">
<violation number="1" location="src/omophub/_request.py:100">
P2: Substantial duplicate response/error-handling logic was added; extract shared parsing/error handling to a single helper to avoid divergence bugs.</violation>
</file>
<file name="src/omophub/resources/search.py">
<violation number="1" location="src/omophub/resources/search.py:673">
P2: `paginate_async` already exists in `_pagination.py` and is purpose-built for this. The sync counterpart `Search.semantic_iter` correctly delegates to `paginate_sync`, but this async version manually reimplements the same pagination loop. Use `paginate_async` for consistency and to avoid duplicating pagination logic.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| - HTTP/2 support via httpx | ||
|
|
||
| [Unreleased]: https://github.com/omopHub/omophub-python/compare/v0.1.0...HEAD | ||
| [Unreleased]: https://github.com/omopHub/omophub-python/compare/v1.4.1...HEAD |
There was a problem hiding this comment.
P2: Update the [Unreleased] compare link to start from v1.5.1 (latest release), not v1.4.1.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At CHANGELOG.md, line 120:
<comment>Update the `[Unreleased]` compare link to start from `v1.5.1` (latest release), not `v1.4.1`.</comment>
<file context>
@@ -27,5 +117,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- HTTP/2 support via httpx
-[Unreleased]: https://github.com/omopHub/omophub-python/compare/v0.1.0...HEAD
+[Unreleased]: https://github.com/omopHub/omophub-python/compare/v1.4.1...HEAD
+[1.4.1]: https://github.com/omopHub/omophub-python/compare/v1.4.0...v1.4.1
+[1.4.0]: https://github.com/omopHub/omophub-python/compare/v1.3.1...v1.4.0
</file context>
| [Unreleased]: https://github.com/omopHub/omophub-python/compare/v1.4.1...HEAD | |
| [Unreleased]: https://github.com/omopHub/omophub-python/compare/v1.5.1...HEAD |
|
|
||
| ### Prerequisites | ||
|
|
||
| - Python 3.9+ |
There was a problem hiding this comment.
P2: The documented Python prerequisite is too low for this project. Update it to match the actual supported version (>=3.10) to avoid setup failures for contributors using 3.9.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At CONTRIBUTING.md, line 56:
<comment>The documented Python prerequisite is too low for this project. Update it to match the actual supported version (`>=3.10`) to avoid setup failures for contributors using 3.9.</comment>
<file context>
@@ -0,0 +1,160 @@
+
+### Prerequisites
+
+- Python 3.9+
+- pip
+
</file context>
| response: APIResponse = data # type: ignore[assignment] | ||
| return response.get("data", data) | ||
|
|
||
| def _parse_response_raw( |
There was a problem hiding this comment.
P2: Substantial duplicate response/error-handling logic was added; extract shared parsing/error handling to a single helper to avoid divergence bugs.
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 100:
<comment>Substantial duplicate response/error-handling logic was added; extract shared parsing/error handling to a single helper to avoid divergence bugs.</comment>
<file context>
@@ -97,6 +97,62 @@ def _parse_response(
response: APIResponse = data # type: ignore[assignment]
return response.get("data", data)
+ def _parse_response_raw(
+ self,
+ content: bytes,
</file context>
| page_size: int = DEFAULT_PAGE_SIZE, | ||
| ) -> AsyncIterator[SemanticSearchResult]: | ||
| """Iterate through all semantic search results with auto-pagination.""" | ||
| page = 1 |
There was a problem hiding this comment.
P2: paginate_async already exists in _pagination.py and is purpose-built for this. The sync counterpart Search.semantic_iter correctly delegates to paginate_sync, but this async version manually reimplements the same pagination loop. Use paginate_async for consistency and to avoid duplicating pagination logic.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/omophub/resources/search.py, line 673:
<comment>`paginate_async` already exists in `_pagination.py` and is purpose-built for this. The sync counterpart `Search.semantic_iter` correctly delegates to `paginate_sync`, but this async version manually reimplements the same pagination loop. Use `paginate_async` for consistency and to avoid duplicating pagination logic.</comment>
<file context>
@@ -297,49 +584,223 @@ async def advanced(
+ page_size: int = DEFAULT_PAGE_SIZE,
+ ) -> AsyncIterator[SemanticSearchResult]:
+ """Iterate through all semantic search results with auto-pagination."""
+ page = 1
+
+ while True:
</file context>
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [1.5.1] - 2026-04-08 |
There was a problem hiding this comment.
P3: Add link definitions for the new [1.5.1] and [1.5.0] changelog sections so those headings resolve correctly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At CHANGELOG.md, line 8:
<comment>Add link definitions for the new `[1.5.1]` and `[1.5.0]` changelog sections so those headings resolve correctly.</comment>
<file context>
@@ -5,6 +5,96 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.5.1] - 2026-04-08
+
+### Fixed
</file context>
* Enhance HTTP client with FHIR resource support and improve rate-limit handling - Added FHIR resource access to both synchronous and asynchronous OMOPHub clients. - Updated CHANGELOG to reflect changes in rate-limit handling, including honoring the `Retry-After` header and implementing exponential backoff with jitter for retries. - Included new FHIR-related types in the type definitions for better integration. * Back merge (#7) * CI pipeline * Publish action * Refactor type hinting for vocabulary_ids to use builtins.list for consistency * Import builtins conditionally in type checking for improved clarity * Codecov settings in CI * Update README.md to include Codecov badge and change License badge color * Update CHANGELOG for v0.2.0: add parameters to `concepts.get_by_code()` for synonyms and relationships, and update User-Agent header format. * Update CHANGELOG.md * Add website link to README.md * Readme updates * Documentation * Corrections * v1.3.0 preparation * Release preparation * Integration tests * Improved tests * Examples update * Downloads badge * Sponsorship * Add integration tests for standard concept filtering and multiple filters with pagination * Prepare release v1.3.1 * Refactor tests for API key validation and enhance request handling tests. Updated synchronous and asynchronous client tests to use monkeypatching for API key checks. Added new tests for handling raw requests, including error parsing, rate limits, and JSON decoding issues. * Update vocab_version in tests for consistency across mock responses and client configurations. * Extending mapping method with source_codes option * Add semantic and similar search functionality with corresponding types and integration tests - Introduced `semantic` and `similar` search methods in the search resource, allowing for advanced concept searches using neural embeddings and similarity algorithms. - Added new TypedDicts for `SemanticSearchResult`, `SemanticSearchMeta`, `SimilarConcept`, and `SimilarSearchResult` to structure the response data. - Implemented integration tests for semantic search, including filtering and pagination, as well as tests for finding similar concepts by ID and name. - Updated type imports and ensured compatibility with existing search functionality. * Add semantic search examples to README * Refactor README and integration tests to streamline result extraction - Updated README example to reflect changes in the results structure for semantic search. - Refactored integration tests to utilize a new `extract_data` function for consistent handling of results and similar concepts, improving code clarity and maintainability. * Update CI workflow to support multiple branches and manual triggering * Update minimum similarity threshold in search.py from 0.3 to 0.5 for improved filtering accuracy. * v1.4.0 release * Increase rate limit delay in integration tests from 1 second to 2 seconds for improved test reliability. * Update version handling * Prepare v1.4.1 release Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add retry logic for server errors in SyncHTTPClient and AsyncHTTPClientImpl - Implemented retry mechanism for handling server errors (502, 503, 504) in both synchronous and asynchronous HTTP clients. - Added exponential backoff delay for retries to improve resilience against temporary server issues. * Refactor retry condition formatting in SyncHTTPClient and AsyncHTTPClientImpl * Add bulk search functionality to the API - Introduced `bulk_basic` and `bulk_semantic` methods for executing multiple lexical and semantic searches in a single API call, respectively. - Updated the README to include examples for bulk search usage. - Added corresponding types for bulk search inputs and responses in the type definitions. - Implemented integration and unit tests to validate the new bulk search features. * Update type definitions to include bulk search and semantic search types - Added new types for bulk search and semantic search functionalities to the `__all__` exports in `__init__.py`. - Removed previously commented sections for clarity and organization. * Enhance integration tests for bulk search functionality - Updated assertions in `test_bulk_basic_search` to verify that all expected search IDs are present in the results. - Added a check in `test_bulk_semantic_search` to confirm that the SNOMED vocabulary filter is applied to the results. * Prep for v1.5.0 release * Examples update * Update GitHub Actions workflows to use latest action versions - Upgraded `actions/checkout` from v4 to v6 in both `ci.yml` and `publish.yml`. - Updated `codecov/codecov-action` from v4 to v5 in `ci.yml`. - Changed `actions/upload-artifact` and `actions/download-artifact` from v4 to v5 in `publish.yml`. * Add retry logic with exponential backoff and jitter for rate limits and server errors (#6) - Introduced a new `_calculate_retry_delay` function to handle retry delays based on the Retry-After header and exponential backoff with jitter. - Updated `SyncHTTPClient` and `AsyncHTTPClientImpl` to utilize the new retry delay calculation for handling rate limits (429) and server errors (502, 503, 504). - Enhanced retry mechanism to improve resilience against temporary issues. Co-authored-by: alex-omophub <sdk@omophub.com> * Update CHANGELOG for v1.5.1 release --------- Co-authored-by: alex-omophub <sdk@omophub.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * Update CHANGELOG for v1.5.1 release and adjust Python version requirement in CONTRIBUTING.md. Refactor error handling in API request processing by introducing a shared `_parse_and_raise` function to streamline JSON response parsing and error management. Enhance async search functionality with pagination support and update type exports in `__init__.py`. * Refactor pagination and type hinting in async functions. Update `_parse_and_raise` to remove type ignore comment. Add tests for minimal CodeableConcept resolution and async FHIR property caching. * Implement FHIR-to-OMOP concept resolution in v1.6.0, adding methods for single and batch resolution of FHIR codings, and CodeableConcept handling. Refactor shared response parsing in API requests to improve maintainability. Update README with usage examples and correct Python version requirement in CONTRIBUTING.md. * Refactor test for pagination to enforce async callable requirement. Update test name and docstring for clarity, and change fetch_page to be an async function. --------- Co-authored-by: alex-omophub <sdk@omophub.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary by cubic
Back-merge from develop introducing semantic and bulk search, plus improved rate-limit handling with
Retry-Afterand jitter for more reliable requests. This also standardizes params across resources and updates docs, examples, and tests.New Features
search.semantic()andsearch.similar()for embedding-based and concept-similarity search.search.bulk_basic()andsearch.bulk_semantic()to run many queries in one call.hierarchy.get()to fetch ancestors and descendants together, with new filters.Migration
vocabulary_idsanddomain_ids; replacelimit/max_suggestionswithpage_size; supportspageandvocab_release.relationship_type->relationship_ids;target_vocabulary->vocabulary_ids; defaultpage_sizeis 100; newinclude_reverse.vocabulary_ids/domain_ids;standard_onlyreplaced byinclude_invalid; newhierarchy.get(...)for combined view.target_vocabulariescollapsed totarget_vocabulary; paging/quality/context flags removed; useinclude_invalidand optionalvocab_release.vocabularies.get()no longer accepts include options—usevocabularies.stats()andvocabularies.domains();vocabularies.list()defaultpage_size=20;domains.list()now onlyinclude_stats.Written for commit 1915148. Summary will update on new commits.