Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 8.x] Autogenerate Query classes #1917

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Sep 13, 2024

Backport bacfc74 from #1890.

I'll wait to merge this until we are closer to the 8.16.0 release, just in case we need to make more 8.15.x releases out of this branch between now and then.

* Autogenerate Query classes

* handle Python reserved keywords such as from

* replace long deprecated 'filtered' query from tests

* minor code generation updates

* more code generation updates

* address typing issues

* clean up code generation templates

* more code generator cleanup

* add a unit test using some of the generated classes

* no need to "reset" the interface list

* use the transport's DEFAULT type

* include inherited properties in docstrings and constructors

* support legacy FieldValueFactor name for FieldValueFactorScore

* Update utils/generator.py

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

* use the identity operator to check for defaults

* rename interfaces.py to types.py

* leave undocumented classes and attributes with an empty docstring

* add unit test for AttrDict with from reserved keyword

* add a dependency on the transport library

* Update utils/generator.py

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

* list required arguments first in types.py

* add server defaults to argument docstrings

* remove unnecessary quotes from type hints in types.py

* Update utils/templates/types.py.tpl

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

* Update utils/generator.py

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

* Update utils/generator.py

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

* final round of review improvements

---------

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
(cherry picked from commit bacfc74)
@pquentin pquentin closed this Oct 2, 2024
@pquentin pquentin reopened this Oct 2, 2024
@miguelgrinberg miguelgrinberg merged commit ee1dc8f into 8.x Oct 7, 2024
17 checks passed
@miguelgrinberg miguelgrinberg deleted the backport-1890-to-8.x branch October 7, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants