-
Notifications
You must be signed in to change notification settings - Fork 32
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
Refactor metadata route to properly add generation status within the route #2094
Conversation
Hey Hervé! Could you do the following:
I'll review the technical content either later today or Monday |
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.
Hi @HerveRI, thanks for your contributions! I've left a few comments here, but looking forward to hopefully having this reviewed and merged by the end of this week.
changelog_entry.yaml
Outdated
removed: | ||
- "status and message values from build_metadata function" | ||
changed: | ||
- "metadata_route to add status and message values to the |
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.
- "metadata_route to add status and message values to the | |
- metadata_route to add status and message values to the response object |
nitpick, nonblocking: Remove quotes and ensure items are on one line
While YAML does allow for items to be spread across lines, we don't typically do so, and tend to add lines without quotes
policyengine_api/country.py
Outdated
@@ -41,8 +41,6 @@ def __init__(self, country_package_name: str, country_id: str): | |||
|
|||
def build_metadata(self): | |||
self.metadata = dict( | |||
status="ok", | |||
message=None, | |||
result=dict( |
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.
issue, blocking: Remove the result
key and refactor
Your work here removing status
and message
and placing them within the route handler is exactly what we're looking for. However, the code here and below (I'll leave a separate comment illustrating it) creates a doubly-nested result
key, breaking the metadata code. To fix this, I'd recommend removing the result
key here and just returning the dictionary that is its value.
d31a01a
to
3d17c60
Compare
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.
Thanks for these changes @HerveRI! These all look good. Approving.
Fixes #2081. Refactor metadata route to properly add generation status within the route.