-
Notifications
You must be signed in to change notification settings - Fork 681
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
solution #681
base: master
Are you sure you want to change the base?
solution #681
Conversation
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.
Thank you for your hard work on this project! 😊 While you've made great progress, there are a few critical issues that need to be addressed before we can approve the pull request:
-
Missing
.dockerignore
File: The task requires a.dockerignore
file to prevent unnecessary files from being added to the Docker image. Please add this file to meet the task requirements. -
Missing
Dockerfile
: ADockerfile
is essential for Dockerizing the service as per the task requirements. Ensure that you include this file to proceed. -
Docker Hub Image: The task specifies that the Docker image should be published to Docker Hub. Please make sure this step is completed and provide evidence of the published image.
These issues are crucial as they directly impact the core requirements of the task. Once these are resolved, your solution will be much closer to completion. Keep up the great work, and feel free to reach out if you need any help! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
.gitignore
Outdated
@@ -3,6 +3,6 @@ | |||
*.iml | |||
.env | |||
.DS_Store | |||
venv/ | |||
.venv/ |
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.
The .venv/
entry is correctly included to ignore virtual environment directories. However, ensure that this is the correct directory name for your virtual environment. If your virtual environment is named differently, adjust this entry accordingly.
import requests | ||
|
||
|
||
API_KEY = os.getenv("API_KEY") |
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.
Ensure that the API_KEY
environment variable is set in your environment. If it's not set, os.getenv("API_KEY")
will return None
, which will cause issues when making the API request.
# write your code here | ||
pass | ||
try: | ||
weather_response = requests.get(f"{URL}key={API_KEY}&q={FILTERING}") |
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.
Consider checking if API_KEY
is None
before making the request. If it is None
, you should handle this case, perhaps by printing an error message and exiting the function early.
# write your code here | ||
pass | ||
try: | ||
weather_response = requests.get(f"{URL}key={API_KEY}&q={FILTERING}") |
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.
The FILTERING
variable is hardcoded to 'Paris'. If you want to make this dynamic, consider passing it as a parameter to the get_weather
function or fetching it from user input.
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.
Review Summary
Great job on your submission! 🎉 Your .dockerignore
file is well-structured, effectively excluding unnecessary files from the Docker image. The main.py
file is also well-implemented, ensuring proper functionality for fetching and parsing weather data.
However, there are a few critical issues to address:
-
Typo in
Dockerfile
: There's a typo in the environment variable declaration. The lineENV PYTHOUNNBUFFERED=1
should be corrected toENV PYTHONUNBUFFERED=1
to ensure that Python outputs are not buffered. -
Docker Hub Image: Ensure that the Docker image is published to Docker Hub as required by the task. This step is crucial for making your image accessible.
Despite these issues, I'm approving your pull request to help you move forward with your learning. Please review the comments and make the necessary corrections to improve your code. Addressing these points will help you avoid similar problems in the future. Keep up the good work and continue learning from your experiences! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
FROM python:3.12-alpine3.18 | ||
LABEL maintainer="yaroslav" | ||
|
||
ENV PYTHOUNNBUFFERED=1 |
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.
There is a typo in the environment variable name PYTHOUNNBUFFERED
. It should be PYTHONUNBUFFERED
to ensure Python output is sent straight to the terminal without being buffered.
No description provided.