-
Notifications
You must be signed in to change notification settings - Fork 98
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
Remove SQLAlchemy
dependency
#1252
Conversation
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.
Nice, thank you!
"""Populates default env var mapping from a sqlalchemy URL string. | ||
|
||
This is used to configure the test environment from the original MF_SQL_ENGINE_URL environment variable in | ||
a manner compatible with the dbt profile configurations laid out for most supported engines. We return | ||
the parsed URL object so that individual engine configurations can override the environment variables | ||
as needed to match their dbt profile configuration. | ||
""" | ||
parsed_url = sqlalchemy.engine.make_url(url) | ||
# parsed_url = sqlalchemy.engine.make_url(url) |
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.
Delete this.
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.
Updated.
|
||
* This implementation is used to avoid having to specify SQLAlchemy as a dependency. | ||
* Databricks has a URL with a semicolon that separates an additional parameter. e.g. | ||
`databricks://host:port/database;http_path=a/b/c`. Need additional context for why this is done. |
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.
Our original Databricks client was built before they added an officially supported SQLAlchemy client, so we used the JDBC connection URI. https://docs.databricks.com/en/integrations/jdbc/authentication.html
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.
Added in comment.
* Databricks has a URL with a semicolon that separates an additional parameter. e.g. | ||
`databricks://host:port/database;http_path=a/b/c`. Need additional context for why this is done. | ||
""" | ||
url_seperator = ";" |
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.
nit:
url_seperator = ";" | |
url_separator = ";" |
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.
Updated.
Description
The
SQLAlchemy
dependency is only needed because we need to parse the URL for the SQL engine configuration. Since it's relatively straightforward to parse, this PR uses built-inurllib
to do the parsing and removes theSQLAlchemy
dependency.