-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add SpatialAggregate to api #599
Comments
One thing to consider here is that |
Am I right in thinking the idea is to make this aggregation process user-callable, so an API user can use it more generally on any pair of applicable data sets one of which is a subscriber list, and produce a sort of aggregated "product" of the sets? |
Oh, I didn't know there was a #600 until you mentioned it! Yes, I guess my previous question applies more to that, but I'm still a bit hazy about the overall goal and the specific interface changes required for #599 and #600. If you think I should be able to work these out exactly from the summaries given so far, please let me know and I'll study the relevant code further and come up with something. But otherwise I'm assuming you plan to provide a more detailed requirements along those lines. (In other words, I don't want to be waiting for something that won't be provided!) |
FlowAPI is an aggregates API - it should return only data aggregated to a geographic region. As a temporary hack to ensure that, this happens:
Most things don't have an For a lot of the query types we have, there's no natural 'default' spatial unit to aggregate to, which is where #600 comes in - that takes something with a subscriber identifier column, and another thing which assigns a location to each subscriber, and gives you a spatial aggregate. |
OK thanks, but when the call to aggregate() is removed from the cases where it currently occurs, won't that mean the relevant output is no longer aggregated?! Or is the idea to aggregate at source so to speak at the point where the data is initially obtained, and have the API output it to the caller like any other aggregated-at-the-point-of-acquisition output? (If that makes sense) |
Yes. The API requests that previously went: {"query_kind": "daily_location" ...} Should now go: {"query_kind":"spatial_aggregate", "locations":{"query_kind": "daily_location" ...}} |
If that is the only change, it sounds pretty simple. So I'm guessing other changes are also required (including obviously changes to the relevant test cases) |
Following class added in flowmachine/flowmachine/core/server/query_schemas/custom_fields.py, preserving alphabetic order of existing classes:
|
Not sure I follow? |
Modal locations and daily locations are presently dealt with by calling
aggregate()
on any query created by the api. This implicitly returns them wrapped inSpatialAggregate
. This should be made explicit, and the hidden call toaggregate()
removed. This also paves the way for a broader classification of things-that-are-aggregated, which I think might warrant being a marshmallow spec in itself (probably allOf).aggregate()
The text was updated successfully, but these errors were encountered: