Skip to content

Commit

Permalink
Create WorkflowRun.timing namedtuple from the dict (#1587)
Browse files Browse the repository at this point in the history
To stop non-deterministic dictionary ordering ruining our day on Python
3.5, create the namedtuple using the keys of the dictionary.
  • Loading branch information
s-t-e-v-e-n-k committed Jun 27, 2020
1 parent c84fad8 commit 1879518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion github/WorkflowRun.py
Expand Up @@ -233,8 +233,8 @@ def timing(self):
:calls: `GET /repos/:owner/:repo/actions/runs/:run_id/timing <https://developer.github.com/v3/actions/workflow-runs/>`_
:rtype: namedtuple with billable and run_duration_ms members
"""
timingdata = namedtuple("TimingData", ["billable", "run_duration_ms"])
headers, data = self._requester.requestJsonAndCheck("GET", self.url + "/timing")
timingdata = namedtuple("TimingData", data.keys())
return timingdata._make(data.values())

def _initAttributes(self):
Expand Down

0 comments on commit 1879518

Please sign in to comment.