feat: add duckdb as DataSource - Fixes #14563 (#19317)

* + duckdb support

needs the forked version of [duckdb-engine](https://github.com/alitrack/duckdb_engine)

* Update duckdb.py

update  _time_grain_expressions

* removed superfluous get_all_datasource_names def in duckdb engine spec

* added exception handling for duckdb single-threaded RuntimeError

* fixed linter blips and other stylistic cleanup in duckdb.py

* one last round of linter tweaks in test_connection.py for duckdb support

Co-authored-by: Steven Lee <admin@alitrack.com>
Co-authored-by: Richard Whaling <richardwhaling@Richards-MacBook-Pro.local>
This commit is contained in:
Richard Whaling
2022-03-24 02:07:57 -05:00
committed by GitHub
parent 9766726b26
commit 202e34a259
2 changed files with 82 additions and 1 deletions

View File

@@ -91,8 +91,9 @@ class TestConnectionDatabaseCommand(BaseCommand):
engine.dialect.do_ping,
args=(conn,),
)
except sqlite3.ProgrammingError:
except (sqlite3.ProgrammingError, RuntimeError):
# SQLite can't run on a separate thread, so ``func_timeout`` fails
# RuntimeError catches the equivalent error from duckdb.
alive = engine.dialect.do_ping(conn)
except FunctionTimedOut as ex:
raise SupersetTimeoutException(