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 Nov 19, 2020
@c24t c24t requested a review from as a code owner Nov 19, 2020
@google-cla google-cla bot added the cla: yes label Nov 19, 2020
@product-auto-label product-auto-label bot added the api: spanner label Nov 19, 2020
mf2199
mf2199 approved these changes Nov 19, 2020
Copy link
Contributor

@mf2199 mf2199 left a comment

👍 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

@larkee larkee Nov 19, 2020

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

@c24t c24t Nov 19, 2020

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

@larkee larkee Nov 23, 2020

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

larkee
larkee approved these changes Nov 23, 2020
Copy link
Contributor

@larkee larkee left a comment

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

@larkee larkee Nov 23, 2020

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
9 checks passed
@c24t c24t deleted the depend-sqlparse branch Nov 23, 2020
gcf-merge-on-green bot pushed a commit that referenced this issue Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants