Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Dremio alias #28222

Merged
merged 1 commit into from
Apr 26, 2024
Merged

fix: Dremio alias #28222

merged 1 commit into from
Apr 26, 2024

Conversation

betodealmeida
Copy link
Member

SUMMARY

For some reason the 3.x version of the Dremio driver shows the dialect as dremio+flight, instead of simply dremio with the driver flight.

This PR adds dremio+flight to the list of aliases in the Dremio DB engine spec, so that Dremio shows up in the database dropdown correctly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Tested locally, connected to Dremio:

  1. Run Dremio locally: docker run -p 9047:9047 -p 31010:31010 -p 32010:32010 -p 45678:45678 dremio/dremio-oss
  2. Visit http://localhost:9047/ and create an account.
  3. Use dremio+flight://username:password@localhost:32010/?UseEncryption=false for the SQLAlchemy URI.
  4. Run a query.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@@ -154,7 +154,7 @@ def get_available_engine_specs() -> dict[type[BaseEngineSpec], set[str]]:
try:
dialect = ep.load()
except Exception as ex: # pylint: disable=broad-except
logger.warning("Unable to load SQLAlchemy dialect %s: %s", dialect, ex)
logger.warning("Unable to load SQLAlchemy dialect %s: %s", ep.name, ex)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When ep.load() failed on line 155 this would show the name of the previous dialect successfully loaded.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this has been working correctly for other drivers, wouldn't this indicate that the problem is in the Dremio driver? I'm assuming we've never had trouble with postgresql+psycopg2, despite not aliasing for it..?

@betodealmeida
Copy link
Member Author

If this has been working correctly for other drivers, wouldn't this indicate that the problem is in the Dremio driver? I'm assuming we've never had trouble with postgresql+psycopg2, despite not aliasing for it..?

@villebro yeah, the problem is in the driver. I took a look at their repo and couldn't see anything wrong, but I'm going to file a ticket about it.

Here's the odd behavior:

>>> from sqlalchemy import create_engine
>>> engine = create_engine("dremio+flight://beto:XXX@localhost:32010/dremio")
>>> engine.dialect.name
'dremio+flight'
>>> engine.dialect.driver
'dremio+flight'

On the other hand:

>>> engine = create_engine("shillelagh+apsw://")
>>> engine.dialect.name
'shillelagh'
>>> engine.dialect.driver
'apsw'

@betodealmeida betodealmeida merged commit 173d5d0 into master Apr 26, 2024
28 of 29 checks passed
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
@michael-s-molina michael-s-molina added v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch labels Apr 29, 2024
michael-s-molina pushed a commit that referenced this pull request Apr 29, 2024
(cherry picked from commit 173d5d0)
michael-s-molina pushed a commit that referenced this pull request Apr 29, 2024
(cherry picked from commit 173d5d0)
jzhao62 pushed a commit to jzhao62/superset that referenced this pull request May 16, 2024
@mistercrunch mistercrunch added 🍒 3.1.3 🍒 4.0.1 🍒 4.0.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 2, 2024
@rusackas rusackas deleted the dremio-alias branch September 27, 2024 21:04
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🍒 3.1.3 🍒 4.0.1 🍒 4.0.2 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants