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

Implement ordering of results (default order and through QueryParameters argument) #171

Open
kevinstadler opened this issue Dec 11, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request priority Needs urgent fix

Comments

@kevinstadler
Copy link

Ordering of results should be possible based on a single scalar field of the root model.

  1. should be able to specify default order via ConfigDict of root python model
  2. should be specifiable dynamically through a QueryParameter (that can be exposed to FastAPI)
@kevinstadler kevinstadler added enhancement New feature or request priority Needs urgent fix labels Dec 11, 2024
@kevinstadler kevinstadler changed the title Implement ordering (via QueryParameters argument) Implement ordering of results (default order and through QueryParameters argument) Dec 11, 2024
@lu-pl lu-pl removed the priority Needs urgent fix label Dec 11, 2024
@lu-pl lu-pl self-assigned this Dec 17, 2024
@lu-pl lu-pl added the priority Needs urgent fix label Feb 2, 2025
lu-pl added a commit that referenced this issue Feb 6, 2025
lu-pl added a commit that referenced this issue Feb 6, 2025
lu-pl added a commit that referenced this issue Feb 6, 2025
@lu-pl
Copy link
Contributor

lu-pl commented Feb 6, 2025

Note: If ordering should be possible 1. via query parameters and 2. model_config, then query parameter ordering should take precedence over model_config orderings.

We discussed possible ordering by all scalar fields, i.e. also scalar fields of potentially nested models. This introduces the significant problem of how to handle alias name clashes though. So I am for restricting order-able fields to the top model scalar fields.

It is still possible to order by arbitrary SPARQL bindings through the model then, i.e. by using excluded fields in the top model. See e.g. the ungrouped wikidata example.

lu-pl added a commit that referenced this issue Feb 6, 2025
@lu-pl lu-pl added this to the v0.3.0 release milestone Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority Needs urgent fix
Projects
None yet
Development

No branches or pull requests

2 participants