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

apply aggregation support #39

Open
meitham opened this issue Apr 13, 2023 · 2 comments
Open

apply aggregation support #39

meitham opened this issue Apr 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@meitham
Copy link

meitham commented Apr 13, 2023

Hi Oliver,

Are there any plans to add support for aggregations? I'm basically after simple support of cases such as

/api/odata/Orders?$apply=aggregate($count as OrderCount)

Ideally this translates as a sqlalchemy sa.select([sa.func.count(Orders).label('OrderCount')]).

I am happy to help adding support for this feature, but it requires a change to the grammer and I will need guidenace on best way to implement.

Many thanks
Meitham

@OliverHofkens
Copy link
Member

Hey @meitham,

There are currently no active plans to support $apply.
But I think it's a really cool use case, and would love to have it in the future (just like $select, see #1 ).

This is going to be a big change though, maybe even needing a seperate parser for each function. I'm not familiar enough with that part of the OData spec yet. Will have to look into it!

I think if we're going to go for such a big change, we might need to re-think the parser entirely. It's currently built with SLY, which seems to be retiring.

@OliverHofkens OliverHofkens added the enhancement New feature or request label Apr 14, 2023
@troughton-carhartt
Copy link

troughton-carhartt commented Jan 26, 2024

Kind of crazy there isn't a really widely used Django OData library yet. This one could definitely fill that void - love it so far. Support for $top $skip $select $orderby at least would be huge. Hopefully can get some time to help out myself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants