This repository was archived by the owner on Jul 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Latest feedback updates #61
Open
iXavi13
wants to merge
2
commits into
bloomberg:main
Choose a base branch
from
iXavi13:latest-feedback-updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,8 +24,8 @@ def get_all_news() -> list[Article]: | |
| return [] | ||
|
|
||
|
|
||
| def get_featured_news() -> Article | None: | ||
| def get_featured_article() -> Article | None: | ||
| """Get the featured news article from the datastore.""" | ||
| # 1. Get all the articles | ||
| # 2. Return as a list of articles sorted by most recent date | ||
| # 1. Get all the articles and sort by most recent | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this by not most recent date? If it still is, its useful to leave that comment there. |
||
| # 2. Return the most recent article | ||
| return None | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ You are tasked to get news articles from Redis Cache. You will be implementing t | |
| * **Hint 2:** In order to get the articles, look at how the data is written into Redis in `backend/app/__init__.py`. | ||
| * **Hint 3**: You can test the backend / API changes without the frontend code! Run `localhost:8000/{endpoint}`. | ||
| - **Hint 4:** The relevant resources can be found from [resources](./resources/overview.md). | ||
| - **Hint 5:** You will have to parse a datetime returned from Redis. Heres a useful [resource](https://docs.python.org/3/library/datetime.html#datetime.date.fromisoformat). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another useful hint or can be placed elsewhere: |
||
|
|
||
| ## Part 1: Write a function to Format Data | ||
| In `backend/app/newsfeed.py`, implement a private method that can format the data into an article object. Check a json file in `backend/app/resources/dataset/news` to retrieve necessary information to create an article object. | ||
|
|
@@ -24,8 +25,6 @@ Once you finish `get_all_news`, implement `get_newsfeed` function in the `backen | |
| In `backend/app/newsfeed.py`, implement the `get_featured_news` method. You should: | ||
|
|
||
| * Get all the articles | ||
| * Sort the articles by most recent published date and return the list | ||
|
|
||
| Once you finish `get_featured_news`, implement `get_featured_article` function in the `backend/app/__init__.py` for the API. You should be able to utilize the function you implemented above. | ||
|
|
||
| * Sort the articles by most recent published date and return the most recent article | ||
|
|
||
| Once you finish `get_featured_news`, implement `get_featured_article` function in the `backend/app/__init__.py` for the API. You should be able to utilize the function you implemented above. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since we are changing the name of this function, we need to update the solutions also to resemble these changes and whatever else was changed.