Add framework for typing query arguments to methods.
Review Request #14339 — Created Feb. 10, 2025 and submitted
This change adds some machinery for rewriting query argument names so we
can more easily deal with API endpoints that use hyphens in parameters.A couple new classes have been added for basic parameter lists for GET
operations on item and list resources, that include the built-in request
parameters that are supported for all resources.I've also added additional TypedDicts for existing resource subclasses
which have special parameters for their GET operations. This makes it so
something likeroot.get_review_requests(branch=False)
will pop up a
warning that thebranch
parameter must bestr
.
- Ran unit tests.
- Used a test script to verify that typing was correctly passed through
for methods that take kwargs for query parameters.
Summary | ID |
---|---|
ccae3d5a8994a0556186a71f38655124406c67ba |
Description | From | Last Updated |
---|---|---|
redefinition of unused 'Mapping' from line 13 Column: 5 Error code: F811 |
![]() |
|
Missing Version Added. |
|
|
Missing Version Added. |
|
|
These should be switched to keep sort order. |
|
|
Missing Version Added. |
|
|
We should use a Mapping here, so it's not typed as mutable. |
|
|
Should we take headers as Mapping? |
|
|
Missing Version Added. |
|
|
Is this because we transform query_args above? Rather than a cast, it might be more type-safe, if we define a … |
|
|
If we set the parent class to a Mapping, this will need to be changed too. |
|
|
Same with Mapping. Possibly others as well. I won't swamp the review with each instance. |
|
- Commits:
-
Summary ID 435efa40d5fdfa4079680362a0ab50bbabe04c07 d13021e064b3427f1e9cd74d84f6cf9329f2278f - Diff:
-
Revision 2 (+882 -202)
Checks run (2 succeeded)
- Commits:
-
Summary ID d13021e064b3427f1e9cd74d84f6cf9329f2278f ccae3d5a8994a0556186a71f38655124406c67ba - Diff:
-
Revision 3 (+918 -248)