-
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
feat: implement feeds endpoint #79
Conversation
Thanks for opening this pull request! You're awesome. We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of titles with semantic prefixes:
|
There are also some query parameters to implement, namely |
api/src/feeds/impl/feeds_api_impl.py
Outdated
@@ -12,6 +16,24 @@ | |||
from feeds_gen.models.latest_dataset import LatestDataset | |||
from feeds_gen.models.source_info import SourceInfo | |||
|
|||
from database.database import Database | |||
|
|||
db = Database() |
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 to have: we should probably set up a mechanism to have a single instance of the database (singleton pattern). Instantiating the database as a global variable might increase the risk of concurrency issues and creates a lack of control over initialization in case we need to make any changes to it.
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.
moved to a global variable in database module
api/src/feeds/impl/feeds_api_impl.py
Outdated
db = Database() | ||
|
||
|
||
def map_feed(feed: Feed): |
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.
Suggestion: this function could be added to a utils
file/module if you think it's going to be used by other classes or added as a static method of the FeedApiImpl
class otherwise to keep the coding style consistent.
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.
moved to a static method in this class as this looks specific to this module
Added |
@cka-y we saw that you added changes to provider field in |
Summary:
Implements:
Expected behavior:
Screenshots from Postman requests against local API:
a7">