Skip to content

Commit

Permalink
Merge pull request #405 from robbrad/399-DeprecationWarning
Browse files Browse the repository at this point in the history
fix: #399 - DeprecationWarning: Python Package holidays
  • Loading branch information
OliverCullimore authored Oct 30, 2023
2 parents 28002bc + f38ad2c commit 55076cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion uk_bin_collection/tests/test_common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_is_holiday():

def test_is_holiday_region():
date = "20"
result = is_holiday("2022, 12, 25", Region.Wales)
result = is_holiday("2022, 12, 25", Region.WLS)
assert result is True


Expand Down
8 changes: 4 additions & 4 deletions uk_bin_collection/uk_bin_collection/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

class Region(Enum):
UK = 1
England = 2
Northern_Ireland = 3
Scotland = 4
Wales = 5
ENG = 2
NIR = 3
SCT = 4
WLS = 5


def check_postcode(postcode: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
for item in regular_collections:
item_as_date = datetime.strptime(item, date_format)
# Check if holiday (calendar only has one day that's a holiday, and it's moved to the next day)
if is_holiday(item_as_date, Region.England):
if is_holiday(item_as_date, Region.ENG):
item_as_date += timedelta(days=1)
# Use the isoweek number to separate collections - at the time of writing 11th Jan is week 2, which
# is for the grey bin
Expand Down

0 comments on commit 55076cd

Please sign in to comment.