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

Update Spain holidays #1476

Merged
merged 3 commits into from
Sep 22, 2023
Merged

Update Spain holidays #1476

merged 3 commits into from
Sep 22, 2023

Conversation

KJhellico
Copy link
Collaborator

Proposed change

Update Spain holidays (checked with official sources for 2010-2023).

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new python-holidays functionality in general)

Checklist

  • I've followed the contributing guidelines
  • I've added references to all holidays information sources used in this PR
  • This PR is filed against beta branch of the repository
  • This PR doesn't contain any merge conflicts and has clean commit history
  • The code style looks good: make pre-commit command generates no changes
  • All tests pass locally: make test, make tox (we strongly encourage adding tests to your code)
  • The related documentation has been added/updated (check off the box for free if no updates is required)

@coveralls
Copy link

coveralls commented Sep 17, 2023

Pull Request Test Coverage Report for Build 6260031150

  • 330 of 330 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 6225670469: 0.0%
Covered Lines: 9395
Relevant Lines: 9395

💛 - Coveralls

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

Nicely done! I believe the covered holiday dates precision will be drastically increased!

I noticed you're using (I guess intentionally) multiple identical ifs for different (chronologically within a year) holidays: if self._year in {2013, 2019}:, if self._year in {2015, 2020}: Would it be possible to combine those or the current order is absolutely necessary for the resulting holiday list? If that's just a readability choice we should consider readabiity/performance tradeoffs before applying this approach widely.

Also some minor comments, mostly naming:

holidays/countries/spain.py Outdated Show resolved Hide resolved
holidays/countries/spain.py Outdated Show resolved Hide resolved
holidays/countries/spain.py Show resolved Hide resolved
holidays/countries/spain.py Show resolved Hide resolved
holidays/countries/spain.py Outdated Show resolved Hide resolved
holidays/countries/spain.py Outdated Show resolved Hide resolved
tests/countries/test_spain.py Outdated Show resolved Hide resolved
tests/countries/test_spain.py Outdated Show resolved Hide resolved
tests/countries/test_spain.py Outdated Show resolved Hide resolved
tests/countries/test_spain.py Outdated Show resolved Hide resolved
@KJhellico
Copy link
Collaborator Author

I noticed you're using (I guess intentionally) multiple identical ifs for different (chronologically within a year) holidays: if self._year in {2013, 2019}:, if self._year in {2015, 2020}: Would it be possible to combine those or the current order is absolutely necessary for the resulting holiday list? If that's just a readability choice we should consider readabiity/performance tradeoffs before applying this approach widely.

No, order is not important, but in some of the following years one of these holidays may exist (in this province), and other may not. And if will have to be divided again. :)

holidays/countries/spain.py Show resolved Hide resolved
@arkid15r arkid15r added this pull request to the merge queue Sep 22, 2023
Merged via the queue into vacanza:beta with commit 5694691 Sep 22, 2023
22 checks passed
@KJhellico KJhellico deleted the upd-spain branch September 22, 2023 16:48
This was referenced Sep 25, 2023
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.

None yet

3 participants