Skip to content
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 #352

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

solution #352

wants to merge 5 commits into from

Conversation

serhiik05
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 your code is generally well-structured and meets most of the task requirements, there are a few critical issues that need to be addressed before we can approve the pull request:

  1. Output Path Handling: The main function currently ignores the output_csv_path parameter and writes to a hardcoded file name 'result.csv'. This limits the flexibility of your code. Please update the write_quotes_to_csv call to use the output_csv_path parameter instead.

  2. Type Hinting: The type hint [Quote] should be corrected to List[Quote] to accurately represent a list of Quote objects. Ensure you import List from the typing module to fix this issue.

These changes are important to ensure the functionality and flexibility of your code. Once you've made these updates, feel free to resubmit your pull request. Keep up the great work! 😊

✨ 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.

app/parse.py Outdated
)


def get_quotes() -> [Quote]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type hint [Quote] is not correct. It should be List[Quote] to indicate a list of Quote objects. Make sure to import List from the typing module.

app/parse.py Outdated
return all_quotes


def write_quotes_to_csv(quotes: [Quote]) -> None:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous comment, the type hint [Quote] should be List[Quote] to correctly indicate a list of Quote objects. Ensure you import List from the typing module.



def write_quotes_to_csv(quotes: [Quote]) -> None:
with open("result.csv", "w") as f:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the output_csv_path parameter in the main function to specify the file path for the CSV output. This will make the function more flexible and allow the user to specify different output paths.

def main(output_csv_path: str) -> None:
pass
write_quotes_to_csv(get_quotes())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main function currently ignores the output_csv_path parameter and writes to a hardcoded file name 'result.csv'. Update the write_quotes_to_csv call to use output_csv_path instead.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your Pull Request has been approved! 🎉 Great job on addressing the initial issues. However, there are a few important points to consider for future improvements:

  1. Output Path Handling: While the main function now correctly passes the output_csv_path parameter, the write_quotes_to_csv function still writes to a hardcoded file name 'result.csv'. Please update this function to accept the output_csv_path parameter and use it for writing the CSV file. This change will enhance the flexibility and functionality of your code.

  2. Type Hinting: Ensure that the type hint for the tags attribute in the Quote dataclass is updated to List[str] for compatibility with older Python versions. Remember to import List from the typing module.

These adjustments are crucial for ensuring your code functions as intended and adheres to best practices. Keep up the good work, and continue learning from these experiences to refine your coding skills! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -8,8 +16,47 @@ class Quote:
tags: list[str]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type hint list[str] should be changed to List[str] for compatibility with Python versions prior to 3.9. Ensure List is imported from the typing module.



def write_quotes_to_csv(quotes: List[Quote]) -> None:
with open("result.csv", "w") as f:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The write_quotes_to_csv function currently writes to a hardcoded file name 'result.csv'. Consider using the output_csv_path parameter from the main function to allow for flexible output file paths.

def main(output_csv_path: str) -> None:
pass
write_quotes_to_csv(get_quotes())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main function should pass the output_csv_path parameter to the write_quotes_to_csv function to utilize the specified output path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants