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

Added ability for Snowflake to attribute usage to Airflow by adding an application parameter #16420

Merged
merged 8 commits into from Jun 15, 2021
1 change: 1 addition & 0 deletions airflow/providers/snowflake/hooks/snowflake.py
Expand Up @@ -179,6 +179,7 @@ def _get_conn_params(self) -> Dict[str, Optional[str]]:
"role": self.role or role,
"authenticator": self.authenticator or authenticator,
"session_parameters": self.session_parameters or session_parameters,
"application": "AIRFLOW",
Copy link
Member

@kaxil kaxil Jun 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping we could use: AIRFLOW_SNOWFLAKE_PARTNER or a similar environment variable so even the partners don't need to change the provider, what do you think?

Example:

Suggested change
"application": "AIRFLOW",
"application": os.environ.get("AIRFLOW_SNOWFLAKE_PARTNER", "AIRFLOW"),

So it default to AIRFLOW and your partners just need to add that Environment variable in their image, example:

AIRFLOW_SNOWFLAKE_PARTNER=AWS

or

AIRFLOW_SNOWFLAKE_PARTNER=Astronomer

or

AIRFLOW_SNOWFLAKE_PARTNER=GCP

}

# If private_key_file is specified in the extra json, load the contents of the file as a private
Expand Down