Repository: vacanza/holidays
Pull request #2199 (2024-12-30 12:15:22)

Update Ukraine holidays in 1991
<!--
  Thanks for contributing to holidays!
-->

## Proposed change

<!--
  Describe the big picture of your changes.
  Don't forget to link your PR to an existing issue if any.
-->

Update Ukraine holidays in 1991 and fix substituted holidays in some years.

## Type of change

<!--
  Type of change you want to introduce. Please, check one (1) box only!
  If your PR requires multiple boxes to be checked, most likely it needs to
  be split into multiple PRs.
-->

- [ ] New country/market holidays support (thank you!)
- [x] 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/pin/upgrade)
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] Breaking change (a code change causing existing functionality to break)
- [ ] New feature (new `holidays` functionality in general)

## Checklist

<!--
  Put an `x` in the boxes that apply. You can change them after PR is created.
-->

- [x] I've followed the [contributing guidelines][contributing-guidelines]
- [x] I've successfully run `make check`, all checks and tests are green

<!--
  Thanks again for your contribution!
-->

[contributing-guidelines]: https://github.com/vacanza/holidays/blob/dev/CONTRIBUTING.rst
[docs]: https://github.com/vacanza/holidays/tree/dev/docs/source


sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2199) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2199&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2199&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=vacanza_python-holidays&pullRequest=2199&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2199&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2199&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2199)


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/vacanza/holidays/pull/2199?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 100.00%. Comparing base [(`dc9877b`)](https://app.codecov.io/gh/vacanza/holidays/commit/dc9877b2a7573e1cf1c6b9f0a551339cdbd7f20d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza) to head [(`1edc5d2`)](https://app.codecov.io/gh/vacanza/holidays/commit/1edc5d296ebfa5506cf3c2ca3f20584e2a484ad9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##               dev     #2199   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          195       195           
  Lines        11763     11762    -1     
  Branches      1700      1699    -1     
=========================================
- Hits         11763     11762    -1     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/vacanza/holidays/pull/2199?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza).

sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2199) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2199&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2199&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=vacanza_python-holidays&pullRequest=2199&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2199&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2199&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2199)



Patch:
diff --git a/holidays/countries/ukraine.py b/holidays/countries/ukraine.py
index 11881d25..23e18ea1 100644
--- a/holidays/countries/ukraine.py
+++ b/holidays/countries/ukraine.py
@@ -25,8 +25,9 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
     """
     Ukraine holidays.
 
-    Current holidays list:
-        - https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454
+    References:
+        - Labor Code of Ukraine, Art. 73 `<https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454>`_
+        - https://zakon.rada.gov.ua/laws/show/585-12
     """
 
     country = "UA"
@@ -71,10 +72,9 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
             # International Women's Day.
             dts_observed.add(self._add_womens_day(tr("Міжнародний жіночий день")))
 
-        if (self._year >= 2022) == is_martial_law:
-            if self._year >= 1992:
-                # Easter Sunday (Pascha).
-                dts_observed.add(self._add_easter_sunday(tr("Великдень (Пасха)")))
+        if (self._year >= 2022) is is_martial_law:
+            # Easter Sunday (Pascha).
+            dts_observed.add(self._add_easter_sunday(tr("Великдень (Пасха)")))
 
             # Holy Trinity Day.
             dts_observed.add(self._add_whit_sunday(tr("Трійця")))
@@ -169,6 +169,7 @@ class UKR(Ukraine):
 class UkraineStaticHolidays:
     """
         Substituted holidays:
+            - `1991 <https://zakon.rada.gov.ua/laws/show/60-91-%D0%BF>`_
             - `1992 [1] <https://zakon.rada.gov.ua/laws/show/202-92-%D0%BF>`_
             - `1992 [2] <https://zakon.rada.gov.ua/laws/show/377-91-%D0%BF>`_
             - `1993 [1] <https://zakon.rada.gov.ua/laws/show/563-93-%D0%BF>`_
@@ -178,8 +179,9 @@ class UkraineStaticHolidays:
             - `1995 [2] <https://zakon.rada.gov.ua/laws/show/634-95-%D0%BF>`_
             - `1995 [3] <https://zakon.rada.gov.ua/laws/show/266-95-%D0%BF>`_
             - `1996 <https://zakon.rada.gov.ua/laws/show/424-96-%D0%BF>`_
-            - `1997[1] <https://zakon.rada.gov.ua/laws/show/326-97-%D0%BF>`_
-            - `1997[2] <https://zakon.rada.gov.ua/laws/show/1547-96-%D0%BF>`_
+            - `1997 [1] <https://zakon.rada.gov.ua/laws/show/326-97-%D0%BF>`_
+            - `1997 [2] <https://zakon.rada.gov.ua/laws/show/1547-96-%D0%BF>`_
+            - `1998 <https://zakon.rada.gov.ua/laws/show/1404-97-%D0%BF>`_,
             - `1999 [1] <https://zakon.rada.gov.ua/laws/show/1433-99-%D0%BF>`_,
             - `1999 [2] <https://zakon.rada.gov.ua/laws/show/558-99-%D0%BF>`_,
             - `1999 [3] <https://zakon.rada.gov.ua/laws/show/2070-98-%D0%BF>`_
@@ -221,6 +223,11 @@ class UkraineStaticHolidays:
     # Day off (substituted from %s).
     substituted_label = tr("Вихідний день (перенесено з %s)")
     special_public_holidays = {
+        1991: (
+            (MAY, 3, MAY, 5),
+            (MAY, 10, MAY, 12),
+            (JUL, 15, JUL, 13),
+        ),
         1992: (
             (JAN, 6, JAN, 4),
             (APR, 27, MAY, 16),
@@ -244,9 +251,11 @@ class UkraineStaticHolidays:
         1997: (
             (JAN, 2, DEC, 28, 1996),
             (JAN, 6, JAN, 4),
+            (JAN, 8, JAN, 11),
             (APR, 29, APR, 19),
             (APR, 30, MAY, 17),
         ),
+        1998: (JAN, 2, JAN, 4),
         1999: (
             (JAN, 8, JAN, 10),
             (APR, 12, APR, 24),
@@ -324,7 +333,7 @@ class UkraineStaticHolidays:
         ),
         2012: (
             (MAR, 9, MAR, 3),
-            (APR, 20, APR, 28),
+            (APR, 30, APR, 28),
             (JUN, 29, JUL, 7),
             (DEC, 31, DEC, 29),
         ),
diff --git a/snapshots/countries/UA_COMMON.json b/snapshots/countries/UA_COMMON.json
index 84d3aa8d..a84e564c 100644
--- a/snapshots/countries/UA_COMMON.json
+++ b/snapshots/countries/UA_COMMON.json
@@ -2,10 +2,14 @@
     "1991-01-01": "New Year's Day",
     "1991-01-07": "Christmas Day",
     "1991-03-08": "International Women's Day",
+    "1991-04-07": "Easter Sunday (Pascha)",
     "1991-05-01": "International Workers' Solidarity Day",
     "1991-05-02": "International Workers' Solidarity Day",
+    "1991-05-03": "Day off (substituted from 05/05/1991)",
     "1991-05-09": "Victory Day",
+    "1991-05-10": "Day off (substituted from 05/12/1991)",
     "1991-05-26": "Holy Trinity Day",
+    "1991-07-15": "Day off (substituted from 07/13/1991)",
     "1991-07-16": "Independence Day",
     "1991-11-07": "Anniversary of the Great October Socialist Revolution",
     "1991-11-08": "Anniversary of the Great October Socialist Revolution",
@@ -84,6 +88,7 @@
     "1997-01-02": "Day off (substituted from 12/28/1996)",
     "1997-01-06": "Day off (substituted from 01/04/1997)",
     "1997-01-07": "Christmas Day",
+    "1997-01-08": "Day off (substituted from 01/11/1997)",
     "1997-03-08": "International Women's Day",
     "1997-03-10": "International Women's Day (observed)",
     "1997-04-27": "Easter Sunday (Pascha)",
@@ -103,6 +108,7 @@
     "1997-11-08": "Anniversary of the Great October Socialist Revolution",
     "1997-11-10": "Anniversary of the Great October Socialist Revolution (observed)",
     "1998-01-01": "New Year's Day",
+    "1998-01-02": "Day off (substituted from 01/04/1998)",
     "1998-01-07": "Christmas Day",
     "1998-03-08": "International Women's Day",
     "1998-04-19": "Easter Sunday (Pascha)",
@@ -358,7 +364,7 @@
     "2012-03-09": "Day off (substituted from 03/03/2012)",
     "2012-04-15": "Easter Sunday (Pascha)",
     "2012-04-16": "Easter Sunday (Pascha) (observed)",
-    "2012-04-20": "Day off (substituted from 04/28/2012)",
+    "2012-04-30": "Day off (substituted from 04/28/2012)",
     "2012-05-01": "International Workers' Solidarity Day",
     "2012-05-02": "International Workers' Solidarity Day",
     "2012-05-09": "Victory Day",


Test patch:
diff --git a/tests/countries/test_ukraine.py b/tests/countries/test_ukraine.py
index 2d64387c..0cf08561 100644
--- a/tests/countries/test_ukraine.py
+++ b/tests/countries/test_ukraine.py
@@ -93,8 +93,7 @@ class TestUkraine(CommonCountryTests, TestCase):
             "2020-04-19",
             "2021-05-02",
         )
-        self.assertHolidayName(name, range(1992, 2022))
-        self.assertNoHolidayName(name, 1991)
+        self.assertHolidayName(name, range(1991, 2022))
 
         dt = (
             "2010-04-05",
@@ -117,8 +116,9 @@ class TestUkraine(CommonCountryTests, TestCase):
         self.assertNoNonObservedHoliday(dt)
 
     def test_trinity(self):
+        name = "Трійця"
         self.assertHolidayName(
-            "Трійця",
+            name,
             "2010-05-23",
             "2011-06-12",
             "2012-06-03",
@@ -132,6 +132,7 @@ class TestUkraine(CommonCountryTests, TestCase):
             "2020-06-07",
             "2021-06-20",
         )
+        self.assertHolidayName(name, range(1991, 2022))
 
         dt = (
             "2010-05-24",
@@ -252,6 +253,9 @@ class TestUkraine(CommonCountryTests, TestCase):
 
     def test_substituted(self):
         self.assertHoliday(
+            "1991-05-03",
+            "1991-05-10",
+            "1991-07-15",
             "1992-01-06",
             "1992-04-27",
             "1993-01-08",
@@ -264,8 +268,10 @@ class TestUkraine(CommonCountryTests, TestCase):
             "1996-05-10",
             "1997-01-02",
             "1997-01-06",
+            "1997-01-08",
             "1997-04-29",
             "1997-04-30",
+            "1998-01-02",
             "1999-01-08",
             "1999-04-12",
             "1999-08-23",
@@ -318,7 +324,7 @@ class TestUkraine(CommonCountryTests, TestCase):
             "2011-03-07",
             "2011-06-27",
             "2012-03-09",
-            "2012-04-20",
+            "2012-04-30",
             "2012-06-29",
             "2012-12-31",
             "2013-05-03",