Repository navigation
feat: add descriptive error msgs - #1150
Merged
czgu merged 4 commits intoFeb 24, 2023
Merged
Conversation
jczhong84
reviewed
Feb 14, 2023
Comment on lines
126
to
+127
| if previous_query_status != QueryExecutionStatus.DONE.value: | ||
| raise Exception(GENERIC_QUERY_FAILURE_MSG) | ||
| raise Exception(get_datadoc_error_message(previous_query_execution_id)) |
Collaborator
There was a problem hiding this comment.
@czgu do you know why we raise the exception in the next query cell run task, instead of just raising it at the end of the run_query task? In which case we dont need to pass over the previous query result over and can throw the error message directly
czgu
requested changes
Feb 16, 2023
| return query_execution.id | ||
|
|
||
|
|
||
| def get_datadoc_error_message(query_execution_id): |
| )[0] | ||
| data_cell_name = datadoc_logic.get_data_cell_by_id( | ||
| data_cell_id, session=session | ||
| ).meta.get("title") |
Collaborator
There was a problem hiding this comment.
title might be empty, can you add a default value here
| data_cell_name = datadoc_logic.get_data_cell_by_id( | ||
| data_cell_id, session=session | ||
| ).meta.get("title") | ||
| query_execution_error = qe_logic.get_query_execution_by_id( |
Collaborator
There was a problem hiding this comment.
use get_query_execution_error
czgu
requested changes
Feb 21, 2023
| @with_session | ||
| def get_datadoc_error_message(query_execution_id, data_cell_id=None, session=None): | ||
| if not data_cell_id: | ||
| _, data_cell_id = qe_logic.get_datadoc_id_from_query_execution_id( |
Collaborator
There was a problem hiding this comment.
sorry for my last comment, I just realized I made a mistake because you need the previous cell id, not the current one
| data_cell_name = datadoc_logic.get_data_cell_by_id( | ||
| data_cell_id, session=session | ||
| ).meta.get("title") | ||
| if not data_cell_name: |
Collaborator
There was a problem hiding this comment.
data_cell_name = datadoc_logic.get_data_cell_by_id(
data_cell_id, session=session
).meta.get("title", f"Untitled Cell Id [{data_cell_id}]")| ) | ||
| query_execution_error_message = None | ||
| if query_execution_error: | ||
| if query_execution_error.error_message_extracted: |
Collaborator
There was a problem hiding this comment.
query_execution_error_message = query_execution_error.error_message_extracted if query_execution_error.error_message_extracted else query_execution_error.error_message
error_msg = (f'Failure in "{data_cell_name}": {query_execution_error_message}'
if query_execution_error_message is not None
else GENERIC_QUERY_FAILURE_MSG
)[:description_len]
czgu
approved these changes
Feb 24, 2023
rohan-sh1
pushed a commit
to CAI-TECHNOLOGIES/cai-ext-db-explorer
that referenced
this pull request
Apr 11, 2023
* feat: add descriptive error msgs * fix: only get error msg if exec error * chore: refactor get_datadoc_error_message * chore: refactor helper func, del data_cell_id arg
aidenprice
pushed a commit
to arrowtail-precision/querybook
that referenced
this pull request
Jan 3, 2024
* feat: add descriptive error msgs * fix: only get error msg if exec error * chore: refactor get_datadoc_error_message * chore: refactor helper func, del data_cell_id arg
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds more descriptive error messages when running a datadoc fails. This error message contains the exact error from the query cell, and the name of the failed query cell to help pinpoint the location of the error.