airflow.providers.snowflake.utils.common
¶
Module Contents¶
Functions¶
|
Replace all single quotes in parameter by two single quotes and enclose param in single quote. |
- airflow.providers.snowflake.utils.common.enclose_param(param)[source]¶
Replace all single quotes in parameter by two single quotes and enclose param in single quote.
See also
https://docs.snowflake.com/en/sql-reference/data-types-text.html#single-quoted-string-constants
- Examples:
enclose_param("without quotes") # Returns: 'without quotes' enclose_param("'with quotes'") # Returns: '''with quotes''' enclose_param("Today's sales projections") # Returns: 'Today''s sales projections' enclose_param("sample/john's.csv") # Returns: 'sample/john''s.csv' enclose_param(".*'awesome'.*[.]csv") # Returns: '.*''awesome''.*[.]csv'
- Parameters
param (str) – parameter which required single quotes enclosure.