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 US holidays: add CO Cesar Chavez Day #1629

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

nwithan8
Copy link
Contributor

@nwithan8 nwithan8 commented Jan 4, 2024

Proposed change

  • Add Cesar Chavez Day as optional holiday on March 31 in Colorado (same as in Texas), starting in 2001

Source:

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 run make pre-commit, it didn't generate any changes
  • I've run make test, all tests passed locally

@nwithan8 nwithan8 changed the title [add] Cesar Chavez Day is optional holiday in CO [add] Cesar Chavez Day is optional holiday in Colorado Jan 4, 2024
@nwithan8
Copy link
Contributor Author

nwithan8 commented Jan 4, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

^ I'm not in any position to follow that code smell suggestion and make a constant for the holiday. Seems there's multiple places in the same file where the same raw string is used multiple times (e.g. "Lincoln's Birthday"), so clearly this isn't an actual "problem". Hopefully the CI failure doesn't prevent this from being reviewed and adopted.

@coveralls
Copy link

coveralls commented Jan 4, 2024

Pull Request Test Coverage Report for Build 7429053155

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 7425641631: 0.0%
Covered Lines: 10244
Relevant Lines: 10244

💛 - Coveralls

@PPsyrius
Copy link
Contributor

PPsyrius commented Jan 5, 2024

^ I'm not in any position to follow that code smell suggestion and make a constant for the holiday. Seems there's multiple places in the same file where the same raw string is used multiple times (e.g. "Lincoln's Birthday"), so clearly this isn't an actual "problem". Hopefully the CI failure doesn't prevent this from being reviewed and adopted.

Yeah - ignore that one for now; the actual test_cesar_chavez_day(self) in \tests\countries\test_united_states.py could definitely use some update though :)

    def test_cesar_chavez_day(self):
        name = "Cesar Chavez Day"
        self.assertNoHolidayName(name)
        self.assertHolidayName(
            name, self.state_hols["CA"], (f"{year}-03-31" for year in range(1995, 2050))
        )
        self.assertNoHolidayName(name, self.state_hols["CA"], range(1865, 1995))
        obs_dt = (
            "1996-04-01",
            "2002-04-01",
            "2013-04-01",
            "2019-04-01",
        )
        self.assertHolidayName(f"{name} (Observed)", self.state_hols["CA"], obs_dt)
        self.assertNoNonObservedHolidayName(
            f"{name} (Observed)", UnitedStates(subdiv="CA", observed=False), obs_dt
        )
        self.assertHolidayName(
            name, self.state_hols["CO"], (f"{year}-03-31" for year in range(2001, 2050))
        )
        self.assertNoHolidayName(name, self.state_hols["CO"], range(1865, 2001))
        self.assertHolidayName(
            name, self.state_hols["TX"], (f"{year}-03-31" for year in range(2000, 2050))
        )
        self.assertNoHolidayName(name, self.state_hols["TX"], range(1865, 2000))

Copy link

sonarcloud bot commented Jan 6, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@arkid15r arkid15r changed the title [add] Cesar Chavez Day is optional holiday in Colorado Update US holidays: add CO Cesar Chavez Day Jan 6, 2024
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.

Slick and tidy, thanks for the PR @nwithan8!

@arkid15r arkid15r added this pull request to the merge queue Jan 6, 2024
Merged via the queue into vacanza:beta with commit 464a503 Jan 6, 2024
26 checks passed
@nwithan8 nwithan8 deleted the cesar_chavez_colorado branch January 6, 2024 03:35
@arkid15r arkid15r mentioned this pull request Jan 15, 2024
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

4 participants