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

[computes] fixed session-type extraction for connectors #3724

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amitsrivastava
Copy link
Collaborator

@amitsrivastava amitsrivastava commented May 1, 2024

The problem is that connector based query execution is not able to
reuse session to fetch results. The frontend is sending the correct
session_id but our session fetching logic got broken when the computes
was implemented. we are now looking for the session_type from
compute['name'] for computes, connector['name'] for connector and
then snippets['type'] for old config file based hive/impala sessions.

A related change is to make use of session for get_log and check_status
calls if the frontend is sending it.

Rest is some ruff and other refactoring.

Copy link
Collaborator

@Harshg999 Harshg999 left a comment

Choose a reason for hiding this comment

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

LGTM, possible to add a unit test?

@amitsrivastava amitsrivastava force-pushed the dev/amit/fix_session_types_for_connectors branch from b3ceb92 to 3eff591 Compare May 2, 2024 03:28
@@ -44,6 +42,9 @@
from notebook.connectors.base import Api, QueryError, QueryExpired, OperationTimeout, OperationNotSupported, _get_snippet_name, Notebook, \
get_interpreter, patch_snippet_for_connector

from future import standard_library
standard_library.install_aliases()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove these lines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@agl29 I have not removed it and nothing seem to have crashed this far. We have these install_aliases() at several places in our code base. We need to see if we really need them anymore.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we don't need them, may be it was required for python2 based Hue.

The problem is that connector based query execution is not able to
reuse session to fetch results. The frontend is sending the correct
session_id but our session fetching logic got broken when the computes
was implemented. we are now looking for the session_type from
compute['name'] for computes, connector['name'] for connector and
then snippets['type'] for old config file based hive/impala sessions.

A related change is to make use of session for get_log and check_status
calls if the frontend is sending it.

Rest is some ruff and other refactoring.
@amitsrivastava amitsrivastava force-pushed the dev/amit/fix_session_types_for_connectors branch from f8b4602 to f292cb3 Compare May 22, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants