Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It'll break the package. This identifier is used to register dialect in Python modules system. With this change we'll have to connect like:
And I don't think it'll work at all.
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.
I think it's working fine as you can see in SQLAlchemy spanner dialect test.
The url is
spanner+spanner:///projects/appdev-soda-spanner-staging/instances/sqlalchemy-dialect-test/databases/compliance-test, which is perfectly working now.spanner.spanneris used only to fetch the Dialect class. New version ofsqlalchemyused by defaultspanner+spannerand replace+to.to fetch the entry-point or dialect class.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.
The other way to overcome the failure is to override the method which added or forcefully converted
spannertospanner+spanner.The method is
generate_driver_urland path issqlalchemy/testing/provision.pyUh oh!
There was an error while loading. Please reload this page.
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.
I've checked the tests locally, there is no failure at all. These changes are not needed.
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.
For now compliance tests are failing in you latest opened PR
https://github.com/cloudspannerecosystem/python-spanner-sqlalchemy/pull/27/checks?check_run_id=2119935389
Cloud you help me to solve that issue?
Uh oh!
There was an error while loading. Please reload this page.
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.
Currently I am getting the same error as @HemangChothani which is also showing up on the Github Action. I'm not sure why it didn't show up before given that it does seem to be a issue with
noxfile.py.Pinning to an older version of
sqlalchemydoes not fix the issue on my end.@IlyaFaer How are you running the compliance tests locally? Are you using the nox command? If not, please post the commands that you are running here so we can update the noxfile to match.
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.
@larkee In setup.py file I replace
dependencies = ["sqlalchemy>=1.1.13"]to dependencies = ["sqlalchemy>=1.1.13, <=1.3.23"] and it works for me.The reason of failing the command is they have implemented new method
generate_driver_url()and path issqlalchemy/testing/provision.pyto generate the url for engine. In that method they replace spanner to spanner+spanner and going to find entry point of the library, in older version there was a spanner as a drive-name so they found perfectly, but in the new version they replace+with.and going to find entry point withspanner.spannerbut we havespannerin setup file so it returnsNonethat's why it's failing.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.
@larkee, I'm executing tests locally just as usual, the only difference - I don't install packages on every nox session run, I'm using the local ones:
But if I'll uncomment these installing lines in nox session function, everything will still work.
As a simple select-script (executed without nox) is working fine with any version of SQLAlchemy, we can say registering the dialect should not to be changed (that would be strange, if SQLAlchemy team would change dialect registering mechanism in 1.4 version - it would break all the dialects). But nox session is failing, because registering mechanism is not able to find the Spanner dialect class. That makes me think the problem is in installing spanner-sqlalchemy package by nox.
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.
@IlyaFaer I have tried with manually installed
spanner-sqlalchemyandSQLAlchemyand run pytest command manually (WIthout nox) and stillsqlalchemyraising the same error. I think they have changed few things in testing procedure.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.
I can confirm that updating
setup.pywith:fixes the issue. The update to entry point is unneeded.
Two additional notes:
compliance_testsession does not need to explicitly installsqlalchemyorgoogle-cloud-spannerbecause they are automatically install bysession.install("-e", ".")which installsspanner-sqlalchemyusingsetup.pycreate_test_databaseuses the project set by eitherGOOGLE_CLOUD_PROJECTorPROJECT_IDor defaults toemulator-test-projectbut the connection string defined insetup.cfgusing the prod project.