duckdb_engine
duckdb_engine copied to clipboard
fix bug of get_view_names
- fix bug
AttributeError: 'Connection' object has no attribute 'exec_driver_sql'
- add schema support.
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!
-- conventional-commit-lint bot https://conventionalcommits.org/
Codecov Report
Merging #393 (10b8153) into master (53c3961) will decrease coverage by
0.34%. The diff coverage is75.00%.
@@ Coverage Diff @@
## master #393 +/- ##
==========================================
- Coverage 93.46% 93.11% -0.35%
==========================================
Files 8 8
Lines 459 465 +6
==========================================
+ Hits 429 433 +4
- Misses 30 32 +2
| Impacted Files | Coverage Δ | |
|---|---|---|
| duckdb_engine/__init__.py | 90.57% <75.00%> (-1.09%) |
:arrow_down: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
just notice, Superset does not support sqlalchemy 1.4 and newer, so does not support exec_driver_sql
so for new version sqlalchemy,
s = f"SELECT table_name FROM information_schema.tables WHERE table_type='VIEW' and table_schema=%s "
schema = schema if schema is not None else "main"
rs = connection.exec_driver_sql(s % schema)
and for old version, should
s = f"SELECT table_name FROM information_schema.tables WHERE table_type='VIEW' and table_schema=? "
schema = schema if schema is not None else "main"
rs = connection.execute(s ,schema)
``
or view will not show.
Which old versions of sqlalchemy are you trying to support?
It looks like the current superset version only supports >=1.4
https://github.com/apache/superset/blob/master/setup.py#L118
the last release version apache superset 2.0 still needs <1.4
and need another parameter: schema

I've merged most of these changes in another pr, #404 so thanks for those. The remaining changes don't seem to be required and in fact introduce a potential security issue
The fixes will be released shortly