airflow.providers.snowflake.utils.common

Module Contents

Functions

enclose_param(param)

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.

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.

Was this entry helpful?