sqlalchemy_dremio
sqlalchemy_dremio copied to clipboard
AttributeError: 'DremioDialect_flight' object has no attribute 'driver'
Hi, Thank you for creating this! I am hoping the following may be an easy fix. I think there was a change made to SQLAlchemy as it attempts to print driver and name in a warning and this causes the module to fail.
/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/engine/base.py in execute(self, statement, *multiparams, **params)
1304 )
1305 else:
-> 1306 return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
1307
1308 def _execute_function(self, func, multiparams, params, execution_options):
/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/sql/elements.py in _execute_on_connection(self, connection, multiparams, params, execution_options, _force)
330 ):
331 if _force or self.supports_execution:
--> 332 return connection._execute_clauseelement(
333 self, multiparams, params, execution_options
334 )
/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/engine/base.py in _execute_clauseelement(self, elem, multiparams, params, execution_options)
1488 )
1489
-> 1490 compiled_sql, extracted_params, cache_hit = elem._compile_w_cache(
1491 dialect=dialect,
1492 compiled_cache=compiled_cache,
/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/sql/elements.py in _compile_w_cache(self, dialect, compiled_cache, column_keys, for_executemany, schema_translate_map, **kw)
510 **kw
511 ):
--> 512 if compiled_cache is not None and dialect._supports_statement_cache:
513 elem_cache_key = self._generate_cache_key()
514 else:
/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py in __get__(self, obj, cls)
1111 if obj is None:
1112 return self
-> 1113 obj.__dict__[self.__name__] = result = self.fget(obj)
1114 return result
1115
/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/engine/default.py in _supports_statement_cache(self)
363 "for SQLAlchemy 1.4 caching support. Alternatively, this "
364 "attribute may be set to False which will disable this "
--> 365 "warning." % (self.name, self.driver),
366 code="cprf",
367 )
AttributeError: 'DremioDialect_flight' object has no attribute 'driver'
Looks like this is already fixed on master - would it be possible to get a bug fix release? @narendrans
Awesome stuff, will wait for @narendrans to reply :)
@tiandklerk How did you solve it?I also encountered this problem
Still not resolved :(
Till @narendrans gets around to fixing this, here's what you add to get around this:
from sqlalchemy_dremio.flight import DremioDialect_flight
DremioDialect_flight.supports_statement_cache = False
This issue should be resolved with #34 in 3.0.4. Please let me know if everything works as expected.