Environment details
- Programming language: Python
- OS: Linux
- Language runtime version: 3.7.12
- Package version:
SQLAlchemy==1.4.26
sqlalchemy-spanner==1.2.0
mysql-connector-python==8.0.26
Steps to reproduce
- Setup an engine for spanner, then setup an engine for mysql using mysqlconnector.
- Run a query on spanner engine, works fine
- Run a query on mysql engine, the query is executed, but throws an error
spanner_engine = sqlalchemy.create_engine("spanner+spanner:///projects/PROJECT/instances/INSTANCE/databases/DB")
mysql_engine = sqlalchemy.create_engine('mysql+mysqlconnector://USER:PASS@HOST/')
print(spanner_engine.execute('SELECT 1').scalar())
print(mysql_engine.execute('SELECT 1').scalar())
Output:
1
Exception during reset or similar
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 739, in _finalize_fairy
fairy._reset(pool)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 982, in _reset
pool.dispatch.reset(self, self._connection_record)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/event/attr.py", line 256, in __call__
fn(*args, **kw)
File "/usr/local/lib/python3.7/site-packages/google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py", line 51, in reset_connection
if dbapi_conn.connection.inside_transaction:
AttributeError: 'CMySQLConnection' object has no attribute 'inside_transaction'
1
It seems to be similar to the issue that is fixed in this PR: #188
The issue was mentioned here #192 (comment), but when using one engine. While using separate engine works, it still throws that error.
I'm currently using this fork to avoid throwing this error, following the comment from @IlyaFaer here #192 (comment)
but I'm not sure if just avoiding that operation is the correct solution.
Thanks!
Environment details
SQLAlchemy==1.4.26
sqlalchemy-spanner==1.2.0
mysql-connector-python==8.0.26
Steps to reproduce
Output:
It seems to be similar to the issue that is fixed in this PR: #188
The issue was mentioned here #192 (comment), but when using one engine. While using separate engine works, it still throws that error.
I'm currently using this fork to avoid throwing this error, following the comment from @IlyaFaer here #192 (comment)
but I'm not sure if just avoiding that operation is the correct solution.
Thanks!