Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

fix: Add sqlparse dependency - #171

Merged
c24t merged 3 commits into
googleapis:masterfrom
c24t:depend-sqlparse
Nov 23, 2020
Merged

fix: Add sqlparse dependency#171
c24t merged 3 commits into
googleapis:masterfrom
c24t:depend-sqlparse

Conversation

@c24t

@c24tc24t commented Nov 19, 2020

Copy link
Copy Markdown
Contributor

#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 a team, larkee and mf2199November 19, 2020 00:22
@google-clagoogle-claBot added the cla: yes This human has signed the Contributor License Agreement. label Nov 19, 2020
@product-auto-labelproduct-auto-labelBot added the api: spanner Issues related to the googleapis/python-spanner API. label Nov 19, 2020

@mf2199mf2199 left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadsetup.py
"proto-plus==1.11.0",
"libcst >= 0.2.5",
"proto-plus == 1.11.0",
"sqlparse >= 0.3.0",

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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

@larkeelarkee left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadsetup.py
"proto-plus==1.11.0",
"libcst >= 0.2.5",
"proto-plus == 1.11.0",
"sqlparse >= 0.3.0",

Copy link
Copy Markdown
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:masterNov 23, 2020
@c24t
c24t deleted the depend-sqlparse branch November 23, 2020 22:09
gcf-merge-on-greenBot pushed a commit that referenced this pull request Nov 30, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spannerIssues related to the googleapis/python-spanner API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@c24t@larkee@mf2199