-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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(20428): Address-Presto/Trino-Poll-Issue-Refactor #20434
Merged
john-bodley
merged 3 commits into
apache:master
from
Thelin90:fix(20428)-Address-Presto/Trino-Poll-Issue-Refactor
Jun 19, 2022
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,20 @@ | |
# specific language governing permissions and limitations | ||
# under the License. | ||
import logging | ||
from typing import Any, Dict, Optional, TYPE_CHECKING | ||
import time | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should revert any of the now unnecessary imports. |
||
from typing import Any, Dict, List, Optional, TYPE_CHECKING | ||
|
||
import simplejson as json | ||
from flask import current_app | ||
from sqlalchemy.engine.reflection import Inspector | ||
from sqlalchemy.engine.url import URL | ||
from sqlalchemy.orm import Session | ||
|
||
from superset.common.db_query_status import QueryStatus | ||
from superset.databases.utils import make_url_safe | ||
from superset.db_engine_specs.base import BaseEngineSpec | ||
from superset.db_engine_specs.presto import PrestoEngineSpec | ||
from superset.models.sql_lab import Query | ||
from superset.utils import core as utils | ||
|
||
if TYPE_CHECKING: | ||
|
@@ -77,6 +82,37 @@ def modify_url_for_impersonation( | |
def get_allow_cost_estimate(cls, extra: Dict[str, Any]) -> bool: | ||
return True | ||
|
||
@classmethod | ||
def get_table_names( | ||
cls, | ||
database: "Database", | ||
inspector: Inspector, | ||
schema: Optional[str], | ||
) -> List[str]: | ||
return BaseEngineSpec.get_table_names( | ||
database=database, | ||
inspector=inspector, | ||
schema=schema, | ||
) | ||
|
||
@classmethod | ||
def get_view_names( | ||
cls, | ||
database: "Database", | ||
inspector: Inspector, | ||
schema: Optional[str], | ||
) -> List[str]: | ||
return BaseEngineSpec.get_view_names( | ||
database=database, | ||
inspector=inspector, | ||
schema=schema, | ||
) | ||
|
||
@classmethod | ||
def handle_cursor(cls, cursor: Any, query: Query, session: Session) -> None: | ||
"""Updates progress information""" | ||
BaseEngineSpec.handle_cursor(cursor=cursor, query=query, session=session) | ||
|
||
@staticmethod | ||
def get_extra_params(database: "Database") -> Dict[str, Any]: | ||
""" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Thelin90 let me test this using Presto to ensure this works. I'll report back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed, via the /extra_table_metadata/<int:database_id>/<table_name>/<schema>/ route—which is invokes said method for views, that the method works as expected without the polling.