time_stats TypeError (method vs dict) #2523
Replies: 1 comment 3 replies
|
TLDR: Just use @walterrowe this if sort of expected, and comes from the fact that python-gitlab actually compensates for that with a custom python-gitlab/gitlab/mixins.py Lines 738 to 750 in 9aecc9e So just always use |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have two instances of GitLab. One is the free community edition. One is EE Premiere Edition.
I query gitlab for a list of issues and accumulate total time spent from time_stats.
I am getting different return types for time_stats between the CE and EE editions. On CE it seems to be a method. On EE it seems to be a dict (as documented in the GitLab API).
On the community edition it seems the time_stats returned with the issue is a method that returns a dict.
If I use this code against the CE (free) edition:
I get this error:
I changed my code as follows and tested it against both editions:
This works around the issue. Is this expected?
The GitLab API indicates time_stats should be a dict at all times.
https://docs.gitlab.com/ee/api/issues.html
All reactions