feat: optimize requirements build#359
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the dependency management for the Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the package's dependencies by integrating datasource support into the core installation, removing the need for separate extras for things like SQL, S3, and Parquet. This simplifies the setup for users who need these common datasources. The changes are consistently applied across the setup.py file, requirements files, and documentation. The example code in the README files has also been updated to be more demonstrative. The overall change is well-executed.
|
|
||
| try: | ||
| from dingo.data.dataset.spark import SparkDataset # noqa E402. | ||
| except Exception as e: |
There was a problem hiding this comment.
It's a good practice to catch more specific exceptions. In this case, a missing optional dependency will raise an ImportError. Catching a more specific exception makes the code more robust and clearly expresses the intent to handle missing optional packages.
| except Exception as e: | |
| except ImportError as e: |
References
- Catching overly broad exceptions like
Exceptioncan hide other unexpected issues. It's better to catch specific exceptions (e.g.,ImportError) to handle expected errors gracefully while letting unexpected ones propagate.
No description provided.