-
-
Notifications
You must be signed in to change notification settings - Fork 541
Update countries/financial with absolute imports #2599
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
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThe update switches relative import statements to absolute imports in two Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)holidays/countries/__init__.py (1)
🔇 Additional comments (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
CONTRIBUTORS
(1 hunks)holidays/countries/__init__.py
(1 hunks)holidays/financial/__init__.py
(1 hunks)
🧰 Additional context used
🪛 Ruff (0.11.9)
holidays/countries/__init__.py
77-77: Line too long (105 > 99)
(E501)
193-193: Line too long (106 > 99)
(E501)
🪛 Pylint (3.3.7)
holidays/countries/__init__.py
[convention] 77-77: Line too long (105/100)
(C0301)
[convention] 193-193: Line too long (106/100)
(C0301)
🔇 Additional comments (3)
CONTRIBUTORS (1)
87-87
: New contributor added
The entry “Laurent Comparet” is inserted in the correct alphabetical position.holidays/financial/__init__.py (1)
15-18
: Converted to absolute imports
The switch from relative (from .module
) to absolute (from holidays.financial.module
) imports is consistent and preserves the public API.holidays/countries/__init__.py (1)
15-203
: Converted to absolute imports
All country modules now use absolute paths (holidays.countries.*
) instead of relative imports. This standardizes import style without altering functionality.🧰 Tools
🪛 Ruff (0.11.9)
77-77: Line too long (105 > 99)
(E501)
193-193: Line too long (106 > 99)
(E501)
🪛 Pylint (3.3.7)
[convention] 77-77: Line too long (105/100)
(C0301)
[convention] 193-193: Line too long (106/100)
(C0301)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2599 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 227 227
Lines 14470 14470
Branches 2027 2027
=========================================
Hits 14470 14470 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
LGTM
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.
LGTM.
|
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.
@laurentco thanks for the contribution 👍
Proposed change
Some of the modules in this library are imported with relative imports, whilst others are imported with absolute imports.
The relative imports fail in some cases, the case I am facing right now is when trying to import the holidays library into a Cloud Composer (Airflow on GCP) plugin.
Whilst this may seem like a very specific case to address here, I see no reason for having a mix of relative and absolute imports in the codebase, especially if this is the source of potential errors: If it works in all cases with absolute imports (as far as I'm aware it should) then let's make it consistent and have all absolute imports across the code base.
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green