Skip to content

Conversation

@alallema
Copy link
Contributor

@alallema alallema commented Jul 5, 2022

Pull Request

What does this PR do?

Add pagination parameters to the get_document() method
Fix if parameters is a list in get_document() and get_tasks()

@alallema alallema requested a review from bidoubiwa July 5, 2022 13:18
@alallema alallema changed the title Add pagination parameters to get_document Add pagination parameters to the get_document() method Jul 5, 2022
)

def get_document(self, document_id: str) -> Dict[str, Any]:
def get_document(self, document_id: str, fields: Optional[List[str]] = None) -> Dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you prefer adding fields as a parameter of the function or a parameter object like on the other routes in case tomorrow we add new params on get_document ?

ex:

    def get_document(self, document_id: str,  parameters: Optional[Dict[str, Any]] = None) -> List[Dict[str, Any]]:

With that we can add new parameters for the get_document route without having to create new function parameters each time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a very good remark but is it worth making a parameter more complex in the risk that others are added, that may never happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I asked the product team and it is quite likely! I will modify it

@alallema alallema requested a review from bidoubiwa July 6, 2022 12:41
@alallema alallema requested a review from bidoubiwa July 7, 2022 07:56
Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

@alallema alallema merged commit e677b44 into bump-meilisearch-v0.28.0 Jul 7, 2022
@alallema alallema deleted the documents_changes branch July 7, 2022 09:34
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.

3 participants