Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 24, 2025

The DataProvider refactoring introduced top-level Search and SearchResponse classes, breaking tests that referenced the old nested DataProvider.SearchResponse.

Test updates:

  • Import and use Search and SearchResponse as top-level classes
  • Instantiate SearchResponse with new Search object instead of individual parameters:
    # Before
    DataProvider.SearchResponse(
        provider=cls, query=q, limit=50, offset=0, sort=None, records=[], total=0
    )
    
    # After  
    SearchResponse(
        provider=cls, search=Search(query=q, limit=50, offset=0, sort=None), records=[], total=0
    )

SearchResponse enhancements:

  • Added limit, title properties and get_search_url(page) method for pagination
  • Fixed __getitem__ to raise KeyError for Mapping interface compliance
  • Improved URL template parsing from split('{')[0] to [:index('{')]

Models updates:

  • Removed duplicate Search dataclass from models.py
  • Changed type hints from 'DataProvider.SearchResponse' to 'SearchResponse'
  • Added itemsPerPage and currentPage fields to Metadata for pagination
  • Exported Search and SearchResponse in public API

All 27 tests now pass with no security issues.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 24, 2025 00:48
Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor DataProvider and implement Search class Fix tests for refactored Search and SearchResponse classes Nov 24, 2025
Copilot AI requested a review from mekarpeles November 24, 2025 00:52
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.

2 participants