-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add invocation env to user agent string #367
Conversation
dbt/adapters/spark/connections.py
Outdated
f"dbt-labs-dbt-spark/{dbt_spark_version} (Databricks)" # noqa | ||
) | ||
dbt_invocation_env = os.getenv(DBT_INVOCATION_ENV) or "manual" | ||
user_agent_entry = f"dbt-labs-dbt-spark/{dbt_spark_version} (Databricks) ({dbt_invocation_env})" # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integration tests don't like this!
Runtime Error
E ('HY000', "[HY000] [unixODBC][Simba][DriverSupport] (2021) Invalid character ')' found in user-agent comment. (2021) (SQLDriverConnect)")
@ueshin Any chance you could advise here? This is an ODBC user agent, maybe the two sets of parens aren't allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, seems like they are not allowed for now. I'm not sure it's a bug or expected, though.
How about using a different pattern like f"dbt-labs-dbt-spark/{dbt_spark_version} (Databricks; {dbt_invocation_env})"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assuming that I'm understanding the use case for this is primarily for dbt Cloud telemetry, then I approve!
Companion PR: databricks/dbt-databricks#106
Description
DBT_INVOCATION_ENV
environment variable to the user agent, per Databricks' request (cc @ueshin @bilalaslamseattle)Checklist
This PR includes tests, or tests are not required/relevant for this PRCHANGELOG.md
and added information about my change to the "dbt-spark next" section.