Skip to content

Wrong return type annotation in ProjectCommit.refs() #1805

Closed

Description

@robertschweizer

Description of the problem, including code/CLI snippet

ProjectCommit.refs() returns List[Dict[str, Any]], but the type annotations say it returns Union[Dict[str, Any], requests.Response].

Specifications

  • python-gitlab version: 3.0.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): -

Activity

  1. nejch commented on Jan 5, 2022

    @nejch
    Member

    Thanks for the report @robertschweizer. Looking at the endpoint, the method currently used is wrong anyway, because we might get a paginated response so we should be doing an http_list() instead. So we should revamp this a little.

  2. nejch commented on Jan 5, 2022

    @nejch
    Member

    We probably also have the same issue with ProjectCommit.diff() and ProjectCommit.merge_requests() at least for typing, and not sure about pagination yet as it is not documented upstream.

  3. JohnVillalovos commented on Jan 5, 2022

    @JohnVillalovos
    Member

    Ah. I had assumed every API call returned a Dict[str, Any]. Okay will need to change things to handle this. Thanks for the report!

  4. added 3 commits that reference this issue on Jan 6, 2022
    9b3db93
    8b4f500
    497e860
  5. locked as resolved and limited conversation to collaborators on Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions