Add possibility of selecting province of country for creation of holiday (#1340)

dataframe
This commit is contained in:
JayCarraway 2020-03-04 01:24:48 +01:00 committed by GitHub
parent 0efd3d2abd
commit 560077c8a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ def get_holiday_names(country):
return set(holiday_names)
def make_holidays_df(year_list, country):
def make_holidays_df(year_list, country, province=None):
"""Make dataframe of holidays for given years and countries
Parameters
@ -57,7 +57,7 @@ def make_holidays_df(year_list, country):
holidays = getattr(hdays_part2, country)(years=year_list)
except AttributeError:
try:
holidays = getattr(hdays_part1, country)(years=year_list)
holidays = getattr(hdays_part1, country)(prov=province,years=year_list)
except AttributeError:
raise AttributeError(
"Holidays in {} are not currently supported!".format(country))