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

fix: #399 - DeprecationWarning: Python Package holidays #405

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading