Closed oscarsj closed 2 months ago
This is due to the github openapi schema change. In the latest schema, the created
query is described as:
created:
name: created
description: 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: query
required: false
schema:
type: string
format: date-time
The format of the field is set to date-time
. We need to make a patch to override this.
Thanks for the swift reaction! ❤
This will be addressed in the next release 😄
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: https://github.com/yanyongyu/githubkit/blob/81c7e863211f2a5a2cf1fb03c4a8c7b0f926e02a/githubkit/typing.py#L83 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
.