holidays is a Python package for determining whether dates are holidays in a specified country. It can support a date dimension whose holiday flags help operational teams plan demand around closures and seasonal peaks. section 6.2 section 6.4
Use the package in either of these implementation contexts:
- In a Snowpark Python worksheet or stored procedure, select the holidays package as a dependency and call holidays.country_holidays(p_country). section 6.2
- In client-side Python, install the package locally, generate dates, and combine each date with the Boolean result of an is_holiday function. section 6.4
- Pass the country explicitly because holiday calendars vary by country; the examples use US and compare results with FR. section 6.2
Country-aware date checks
A procedure call such as PROC_IS_HOLIDAY('2024-01-01', 'US') returns True. July 4 returns True for US and False for FR, while July 14 returns False for US and True for FR. section 6.2
create or replace procedure PROC_IS_HOLIDAY(p_date date, p_country string)
returns String
language python
runtime_version = 3.8
packages =('holidays==0.29', 'snowflake-snowpark-python==*')
handler = 'is_holiday'
comment = 'The procedure returns True if the date is a holiday in the country'
as '
# The Snowpark package is required for Python Worksheets
import snowflake.snowpark as snowpark
# Adding the holidays package
import holidays
def is_holiday... #1
';
Inspect the complete Snowpark procedure definition, including the holidays dependency, Python runtime, handler, and country-aware function. section 6.2
