You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use list_workflow_run functions I'm using created parameter to filter out workflow runs. The way of using this parameter is by providing a string with an arithmetic comparison and a stringified datetime, something like:
This is due to the github openapi schema change. In the latest schema, the created query is described as:
created:
name: createddescription: Returns workflow runs created within the given date-time range.For more information on the syntax, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)."in: queryrequired: falseschema:
type: stringformat: date-time
The format of the field is set to date-time. We need to make a patch to override this.
When I use
list_workflow_run
functions I'm usingcreated
parameter to filter out workflow runs. The way of using this parameter is by providing a string with an arithmetic comparison and a stringified datetime, something like:as you can see, the type of the
created
parameter is astr
.But when I run mypy type checking over this piece of code, I get:
This type checking result is misleading and breaks our automated type-safety checks.
This started happening in version 0.11.8. I think this behaviour can be traced to this line changed:
githubkit/githubkit/typing.py
Line 83 in 81c7e86
on PR https://github.com/yanyongyu/githubkit/pull/117/files#diff-70cf106ab334e2539867d80d8c49a85c44184d1d8c319b3a95c1484a0e5cafbdR83
If I downgrade to 0.11.7 and run mypy, I get no errors:
The script I used to test that the created filter indeed was working and expecting a string is:
https://gist.github.com/oscarsj/600804cb56752ea0047c82220173162b
The expected behaviour is that
created
parameter (and possibly other datetime-like params used for filtering) has a type compatible withstr
.The text was updated successfully, but these errors were encountered: