Skip to content

Conversation

@jaeyson
Copy link
Owner

@jaeyson jaeyson commented Dec 19, 2024

Fixes #7

Summary by Sourcery

Update API client to match the latest OpenAPI spec.

New Features:

  • Added support for new parameters in the following operations:\n* create_collection\n* get_collections

Bug Fixes:

  • Fixed a bug where the ignore_not_found option was not being sent when deleting a document.

Enhancements:

  • Added support for new parameters in the following operations:\n* delete_documents\n* export_documents\n* get_document\n* import_documents\n* multi_search\n* search\n* update_document\n* update_documents

Tests:

  • Added tests for new parameters and updated existing tests to reflect the changes.

@jaeyson jaeyson added the documentation Improvements or additions to documentation label Dec 19, 2024
@jaeyson jaeyson self-assigned this Dec 19, 2024
@jaeyson jaeyson linked an issue Dec 19, 2024 that may be closed by this pull request
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 19, 2024

Reviewer's Guide by Sourcery

This pull request updates the Typesense Elixir client library to match the latest OpenAPI specification. It introduces new query parameters for several API endpoints and updates the type specifications of some function parameters.

Class diagram showing updated Documents module

classDiagram
    class Documents {
        +delete_document(collectionName, documentId, opts)
        +delete_documents(collectionName, opts)
        +export_documents(collectionName, opts)
        +get_document(collectionName, documentId, opts)
        +import_documents(collectionName, body, opts)
        +index_document(collectionName, body, opts)
        +search(collectionName, params)
        +update_document(collectionName, documentId, body, opts)
        +update_documents(collectionName, body, opts)
    }
    note for Documents "Updated query parameters:
- ignore_not_found
- batch_size
- filter_by
- include_fields
- exclude_fields
- return_id
- remote_embedding_batch_size
- remote_embedding_timeout_ms
- remote_embedding_num_tries
- return_doc
- action
- dirty_values"
Loading

Class diagram showing updated Collections module

classDiagram
    class Collections {
        +create_collection(schema, opts)
        +delete_collection(collectionName, opts)
        +get_collection(collectionName, opts)
        +get_collections(opts)
        +update_collection(collectionName, body, opts)
    }
    note for Collections "Updated query parameters:
- src_name
- limit
- offset
- exclude_fields"
Loading

File-Level Changes

Change Details Files
Added ignore_not_found query parameter to the delete_document function.
  • Added a new query parameter ignore_not_found to allow ignoring errors when deleting a document that does not exist.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Added batch_size and filter_by query parameters to the delete_documents function.
  • Added batch_size to control the number of documents deleted at a time.
  • Added filter_by to filter documents to be deleted.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Added filter_by, include_fields, and exclude_fields query parameters to the export_documents function.
  • Added filter_by to filter exported documents.
  • Added include_fields to specify fields to include in the export.
  • Added exclude_fields to specify fields to exclude from the export.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Added include_fields and exclude_fields query parameters to the get_document function.
  • Added include_fields to specify fields to include when retrieving a document.
  • Added exclude_fields to specify fields to exclude when retrieving a document.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Added several query parameters to the import_documents function.
  • Added batch_size to control the number of documents imported at a time.
  • Added return_id to return the IDs of imported documents.
  • Added remote_embedding_batch_size to control batch size for remote embedding APIs.
  • Added remote_embedding_timeout_ms to set timeout for remote embedding APIs.
  • Added remote_embedding_num_tries to set the number of retries for remote embedding APIs.
  • Added return_doc to return the entire document in the response.
  • Added action to specify additional actions to perform during import.
  • Added dirty_values to handle dirty data during import.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Renamed search_collection to search and updated its parameters.
  • Renamed the function from search_collection to search.
  • Updated the function parameters to accept a keyword list for search parameters.
  • Added documentation and examples for the new search function.
  • Removed the old searchParameters option and replaced it with individual search parameters in the keyword list.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Added filter_by query parameter to the update_document function.
  • Added filter_by to filter documents to be updated.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Added filter_by query parameter to the update_documents function.
  • Added filter_by to filter documents to be updated.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/documents.ex
Added query parameters to the get_collections function.
  • Added limit to limit the number of collections returned.
  • Added offset to skip a certain number of results.
  • Added exclude_fields to exclude field definitions from the response.
  • Updated the type specification of the opts parameter to keyword()
lib/open_api_typesense/operations/collections.ex

Assessment against linked issues

Issue Objective Addressed Explanation
#7 Match OpenAPI spec according to official docs

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @jaeyson - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coveralls
Copy link

coveralls commented Dec 19, 2024

Pull Request Test Coverage Report for Build 1f4ad408e87eb05fde4f676b6a8f6ea1a18bd879-PR-8

Details

  • 64 of 64 (100.0%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+32.7%) to 99.442%

Totals Coverage Status
Change from base Build f10b3e8f24e356c5b2c7b6f8fbec12c7b7bb0dfc: 32.7%
Covered Lines: 535
Relevant Lines: 538

💛 - Coveralls

@jaeyson jaeyson merged commit 7d750b3 into main Dec 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Match OpenAPI spec according to official docs

3 participants