mrevutskyi / flask-restless-ng

A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless-ng.readthedocs.io
Other
64 stars 11 forks source link

FunctionAPI alternative? #23

Closed mosheduminer closed 3 years ago

mosheduminer commented 3 years ago

It looks like the FunctionAPI class was removed. Is there an alternative?

By the way, thanks for your swift response on #22.

mosheduminer commented 3 years ago

Never mind, don't know what I was thinking.

mosheduminer commented 3 years ago

Hey, so I figured out what was going on the in the code I was porting. It was monkey patching FunctionAPI, which is used internally for function evaluation in the APIManager. However, I see that the 2.x release has removed function evaluation. Given that this library no longer supports function evaluation, what available alternative is there?

mrevutskyi commented 3 years ago

Somehow missed your response. I guess it depends what were you using function evaluations for. If to collect/aggregate data, then creating a simple Flask endpoint is what I usually do. That way you can also fine-tune your SQL queries (remove unnecessary fields, or joins, etc)

mosheduminer commented 3 years ago

Yeah, that's a good idea, and that may be what I'll do eventually. Unfortunately there's already a large number of consumers of the eval endpoints, and I'd have to take them all into account. For now I am using the original FunctionAPI code and adding it to the blueprints. I don't consider that a great long term option (as it might make version updates more difficult), so I'm considering what to do, including your suggestion 👍.

mrevutskyi commented 3 years ago

I see. I've added it back in version 2.1.0 with a deprecation warning, and going to deprecate it for good in 3.x