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

fix: Add sqlparse dependency #171

Merged
merged 3 commits into from
Nov 23, 2020
Merged

fix: Add sqlparse dependency #171

merged 3 commits into from
Nov 23, 2020

Conversation

c24t
Copy link
Contributor

@c24t c24t commented Nov 19, 2020

#160 added sqlparse as a test dependency only, but included non-test code that imports it. Running the tests outside of nox gives this error: E ModuleNotFoundError: No module named 'sqlparse'.

This PR makes sqlparse a regular non-test dependency.

The version number comes from googleapis/python-spanner-django@2b096c5.

@c24t c24t requested review from larkee and mf2199 November 19, 2020 00:22
@c24t c24t requested a review from a team as a code owner November 19, 2020 00:22
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 19, 2020
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner API. label Nov 19, 2020
Copy link
Contributor

@mf2199 mf2199 left a comment

Choose a reason for hiding this comment

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

👍 Good catch! This is something I wasn't sure about adding on a global scale.

"libcst >= 0.2.5",
"proto-plus == 1.11.0",
"sqlparse >= 0.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

sqlparse is only used for dbapi and is not required for using the Cloud Spanner client. I think it makes more sense to have this as a separate extra dependency similar to the OpenTelemetry dependencies under "tracing".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with making this an optional dependency is that we've got code in the library that will fail to import without it. The library still works without tracing, it just doesn't emit traces.

If we want to avoid sqlparse as a required dependency I see two options: (1) make it an optional import and catch the import errors in the DBAPI package and log an error, or (2) make spanner_dbapi a separate installable package in this repo, with its own set of requirements.

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed I think (2) is the best option

Copy link
Contributor

@larkee larkee left a comment

Choose a reason for hiding this comment

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

LGTM. I would prefer to have spanner_dbapi as a separate installable before doing a release but I won't block you on this.

"libcst >= 0.2.5",
"proto-plus == 1.11.0",
"sqlparse >= 0.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed I think (2) is the best option

@c24t c24t merged commit e801a2e into googleapis:master Nov 23, 2020
@c24t c24t deleted the depend-sqlparse branch November 23, 2020 22:09
gcf-merge-on-green bot pushed a commit that referenced this pull request Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants