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(hive): Remove unused async arg from execute query func to get hive connector working #24984

Closed

Conversation

alldoami
Copy link

SUMMARY

Fixes this issue: #24786

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

): # pylint: disable=arguments-differ
kwargs = {"async": async_}
cursor.execute(query, **kwargs)
def execute(cursor, query: str):
Copy link
Member

@john-bodley john-bodley Aug 15, 2023

Choose a reason for hiding this comment

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

@alldoami I don't believe this approach is correct as the async_ keyword argument is used by the PyHive DB-API here.

Are you using a different DB-API to connect to Hive?

Copy link
Author

Choose a reason for hiding this comment

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

I have the latest python version and I'm getting errors with this kwarg not being recognized.

Copy link
Author

Choose a reason for hiding this comment

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

raise SupersetErrorsException(superset-f79cd4889-88xps superset.exceptions.SupersetErrorsException: [SupersetError(message="databricks error: execute() got an unexpected keyword argument 'async'", error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Databricks Interactive Cluster', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})] 

Copy link
Author

Choose a reason for hiding this comment

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

What package and what version of that package should be required for this to work? This only happens when I try loading Unity Catalog data from Databricks in SQL Lab.

Copy link
Author

Choose a reason for hiding this comment

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

My PyHive is up to date (0.6.5) and python version is 3.9.17

Copy link
Member

Choose a reason for hiding this comment

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

databricks+connector works for me for schema selection as well. this is in 3.0.0.rc3 version

Copy link
Author

@alldoami alldoami Sep 5, 2023

Choose a reason for hiding this comment

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

@bkyryliuk are you able to see Unity Catalog schemas? Not just hive metastore schemas?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I need to specify catalog in the connection string and see the schemas in the catalog:
conn string

databricks+connector://token:{token}@{host}:{port}/{catalog}?catalog={catalog}
{"connect_args":{"http_path":"/sql/1.0/warehouses/{id}","catalog":"{catalog}"}}

I got a bit lazy and did not fully figure out what setting is actually setting the catalog and I think that has changed over time with databricks connector

Copy link
Author

@alldoami alldoami Oct 19, 2023

Choose a reason for hiding this comment

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

Ah this works! I was getting both a little wrong - Is it possible to update the documentation on this so that others can connect to unity catalog?

Copy link
Contributor

@mdeshmu mdeshmu Oct 20, 2023

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants