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

Add Bahamas holidays #1517

Merged
merged 18 commits into from
Oct 19, 2023
Merged

Add Bahamas holidays #1517

merged 18 commits into from
Oct 19, 2023

Conversation

PPsyrius
Copy link
Contributor

Proposed change

Add Bahamas holidays.

Closes #1152.

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
  • 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)

@KJhellico
Copy link
Collaborator

KJhellico commented Oct 17, 2023

@PPsyrius, your research is deep and thorough as always 👍.

About observed holidays. Wikipedia and OfficeHolidays says that:

Events that fall on a Tuesday typically are celebrated on the previous Monday. Holidays that fall on Wednesdays or Thursdays (with the exception of Independence Day, Christmas Day, and Boxing Day) are celebrated the following Friday.

but I can't find any regulatory act that establishes this. On Timeanddate we can see observance of these rules only for the New Year's Day and Discovery Day, and only until 2012.

@KJhellico
Copy link
Collaborator

Seems you forgot to add line to countries/__init__.py :)

PPsyrius and others added 2 commits October 18, 2023 09:54
Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>
…an countries

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
@PPsyrius
Copy link
Contributor Author

@PPsyrius, your research is deep and thorough as always 👍.

About observed holidays. Wikipedia and OfficeHolidays says that:

Events that fall on a Tuesday typically are celebrated on the previous Monday. Holidays that fall on Wednesdays or Thursdays (with the exception of Independence Day, Christmas Day, and Boxing Day) are celebrated the following Friday.

but I can't find any regulatory act that establishes this. On Timeanddate we can see observance of these rules only for the New Year's Day and Discovery Day, and only until 2012.

Well, thanks to your comment, I happened to come across this site run by the Bahamas government with all published laws since 1923. Take the Public Holidays Act (as last published in 2001) or the Majority Rule (Public Holiday) Act 2013 already cited in the PR for example.

Turns out Bahamas's "Labour Day" got its name changed as recently as 2013 in which the existing codes need to be adjusted.

On the topic of in-lieu, after checking the 2022 calendars we have on hand, the observance for New Year's Day appears to only apply if it falls on SUN, not SAT as seen in that year. I'll see what can be done with the ones prior to 2012 soon enough.

@coveralls
Copy link

coveralls commented Oct 18, 2023

Pull Request Test Coverage Report for Build 6579180463

  • 38 of 38 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 99.978%

Totals Coverage Status
Change from base Build 6576669887: 0.001%
Covered Lines: 9963
Relevant Lines: 9963

💛 - Coveralls

holidays/countries/bahamas.py Outdated Show resolved Hide resolved
holidays/countries/bahamas.py Outdated Show resolved Hide resolved
holidays/countries/bahamas.py Outdated Show resolved Hide resolved
PPsyrius and others added 4 commits October 18, 2023 16:50
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
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.

Great stuff, @PPsyrius!

The code wraps pretty much all holidays with ObservedHolidayBase::_add_observed which looks fine but is not really needed for some cases (that never fall on SAT/SUN). I'm going to let you decide whether to keep it as is or apply the PR suggestions.

holidays/countries/bahamas.py Outdated Show resolved Hide resolved
holidays/countries/bahamas.py Outdated Show resolved Hide resolved
holidays/countries/bahamas.py Outdated Show resolved Hide resolved
holidays/countries/bahamas.py Outdated Show resolved Hide resolved
PPsyrius and others added 4 commits October 20, 2023 02:11
Co-authored-by: Arkadii Yakovets <ark@cho.red>
Co-authored-by: Arkadii Yakovets <ark@cho.red>
Co-authored-by: Arkadii Yakovets <ark@cho.red>
Co-authored-by: Arkadii Yakovets <ark@cho.red>
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.

🇧🇸 LGTM

@arkid15r arkid15r added this pull request to the merge queue Oct 19, 2023
Merged via the queue into vacanza:beta with commit 6be7ab9 Oct 19, 2023
22 checks passed
@PPsyrius PPsyrius deleted the bahamas_holidays branch October 20, 2023 02:49
@arkid15r arkid15r mentioned this pull request Nov 6, 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.

Add Bahamas holidays
4 participants