-
Notifications
You must be signed in to change notification settings - Fork 3
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
Extract ES interface from FastAPI routing definition #85
Conversation
…a wrapper and a query builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work - I like this restructuring a lot better. I do agree that now that there are multiple modules it'd make sense to have a package they all sit in. I made some suggestions and requests for clarifications or comments in my notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
- I agree we need to choose whether to continue using
config.yml
or not. I like the idea ofconfig
/settings
module that abstract pulling things from system env vars (or.env
file) in a type-safe manner. This being a FastAPI app, my vote would be to switch to usingpydantic settings
instead of building one from scratch aroundgetnev
. - On introducing a subdirectory, yeah, an
app
orsrc
subdirectory would help but the app itself is also very straightforward so I have no issues with not having one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm at the polar opposite from Rahul (who had enough context to make meaningful review comments). Most of the actual ES workings are outside my comfort zone!
Quick glance at pydantic_settings and I'm impressed- I'll experiment weaving it in now. It should drop-in no problem to the way we're passing in environment variables now, and it would be a one-line change to go back to using a .env file if needed in the future for some reason. |
Floating back through here to reiterate that pydantic_settings is wonderful- one of those tools that makes me wonder how I got by without it. Thanks for the tip @kilemensi |
Addressed the majority of issues, left comments on those I'm not addressing.
Creates queries.py, which contains a QueryBuilder and an EsClientWrapper, separating concerns more explicitly. Also removes unused significant/rare term query logic.
(Addressing #71)
Questions: