Skip to content

Get tasks method crashes when no tasks are included in result #1125

@ddboline

Description

@ddboline

Description
Description of what the bug is about.

The tasks endpoint will return from=null if there are no results, but the TaskResults struct sets the type of from_ to int instead of Optional[int]

e.g. if the http endpoint returns:

{'results': [], 'total': 0, 'limit': 0, 'from': None, 'next': None}

the python package will throw an exception.

Expected behavior
What you expected to happen.

The tasks endpoint should not crash.

Current behavior
What happened.

The tasks endpoint crashes.

Screenshots or Logs
If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. Debian GNU/Linux]
  • Meilisearch version: [e.g. v.1.15.2]
  • meilisearch-python version: [e.g v0.36.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions