Skip to content

Convert to SDK exceptions for RuntimeBackend query executions#769

Merged
nfx merged 6 commits intomainfrom
fix/issue_726
Jan 11, 2024
Merged

Convert to SDK exceptions for RuntimeBackend query executions#769
nfx merged 6 commits intomainfrom
fix/issue_726

Conversation

@pritishpai
Copy link
Copy Markdown
Contributor

Convert the query execution exceptions to SDK exceptions like NotFound, PermissionDenied and SyntaxError (currently used BadRequest to map syntax errors).

Integration and unit tests added.

Fixes #726

Convert to SDK exceptions for RuntimeBackend query executions.
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ff10e67) 81.84% compared to head (1c5e99c) 81.93%.
Report is 1 commits behind head on main.

❗ Current head 1c5e99c differs from pull request most recent head 8311661. Consider uploading reports for the commit 8311661 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #769      +/-   ##
==========================================
+ Coverage   81.84%   81.93%   +0.08%     
==========================================
  Files          39       39              
  Lines        4495     4516      +21     
  Branches      831      835       +4     
==========================================
+ Hits         3679     3700      +21     
  Misses        606      606              
  Partials      210      210              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Collaborator

@nfx nfx left a comment

Choose a reason for hiding this comment

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

Implementation is incorrect and too complicated, simplify and make it also work with fetch() method

Comment thread src/databricks/labs/ucx/framework/crawlers.py
Comment thread src/databricks/labs/ucx/framework/crawlers.py Outdated
Comment thread tests/integration/framework/test_crawlers.py Outdated
Simplifying error handling, more integration and unit tests.
self._spark.sql(sql)
try:
immediate_response = self._spark.sql(sql)
status = immediate_response.status
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's no status in spark sql response, this is incorrect

error_message = str(e)
self._raise_spark_sql_exceptions(error_message)

if status is None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove reliance on status from here altogether

Comment thread src/databricks/labs/ucx/framework/crawlers.py Outdated
Comment thread src/databricks/labs/ucx/framework/crawlers.py Outdated
@nfx nfx merged commit 54c07dc into main Jan 11, 2024
@nfx nfx deleted the fix/issue_726 branch January 11, 2024 17:07
nfx added a commit that referenced this pull request Jan 12, 2024
* Added assessment step to estimate the size of DBFS root tables ([#741](#741)).
* Added `TableMapping` functionality to table migrate ([#752](#752)).
* Added `databricks labs ucx move` command to move tables and schemas between catalogs ([#756](#756)).
* Added functionality to determine migration method based on DBFS Root ([#759](#759)).
* Added `get_tables_to_migrate` functionality in the mapping module ([#755](#755)).
* Added retry and rate limit to rename workspace group operation and corrected rate limit for reflecting account groups to workspace ([#751](#751)).
* Adopted `databricks-labs-blueprint` library for common utilities to be reused in the other projects ([#758](#758)).
* Converted `RuntimeBackend` query executions exceptions to SDK exceptions ([#769](#769)).
* Fixed issue with missing users and temp groups after workspace-local groups migration and skip table when crawling table size if it does not exist anymore ([#770](#770)).
* Improved error handling by not failing group rename step if a group was removed from account before reflecting it to workspace ([#762](#762)).
* Improved error message inference from failed workflow runs ([#753](#753)).
* Moved `TablesMigrate` to a separate module ([#747](#747)).
* Reorganized assessment dashboard to increase readability ([#738](#738)).
* Updated databricks-sdk requirement from ~=0.16.0 to ~=0.17.0 ([#773](#773)).
* Verify metastore exists in current workspace ([#735](#735)).
@nfx nfx mentioned this pull request Jan 12, 2024
nfx added a commit that referenced this pull request Jan 12, 2024
* Added assessment step to estimate the size of DBFS root tables
([#741](#741)).
* Added `TableMapping` functionality to table migrate
([#752](#752)).
* Added `databricks labs ucx move` command to move tables and schemas
between catalogs
([#756](#756)).
* Added functionality to determine migration method based on DBFS Root
([#759](#759)).
* Added `get_tables_to_migrate` functionality in the mapping module
([#755](#755)).
* Added retry and rate limit to rename workspace group operation and
corrected rate limit for reflecting account groups to workspace
([#751](#751)).
* Adopted `databricks-labs-blueprint` library for common utilities to be
reused in the other projects
([#758](#758)).
* Converted `RuntimeBackend` query executions exceptions to SDK
exceptions ([#769](#769)).
* Fixed issue with missing users and temp groups after workspace-local
groups migration and skip table when crawling table size if it does not
exist anymore ([#770](#770)).
* Improved error handling by not failing group rename step if a group
was removed from account before reflecting it to workspace
([#762](#762)).
* Improved error message inference from failed workflow runs
([#753](#753)).
* Moved `TablesMigrate` to a separate module
([#747](#747)).
* Reorganized assessment dashboard to increase readability
([#738](#738)).
* Updated databricks-sdk requirement from ~=0.16.0 to ~=0.17.0
([#773](#773)).
* Verify metastore exists in current workspace
([#735](#735)).
FastLee pushed a commit that referenced this pull request Jan 19, 2024
Convert the query execution exceptions to SDK exceptions like NotFound,
PermissionDenied and SyntaxError (currently used BadRequest to map
syntax errors).

Integration and unit tests added.

Fixes #726

---------

Co-authored-by: Serge Smertin <[email protected]>
FastLee pushed a commit that referenced this pull request Jan 19, 2024
* Added assessment step to estimate the size of DBFS root tables
([#741](#741)).
* Added `TableMapping` functionality to table migrate
([#752](#752)).
* Added `databricks labs ucx move` command to move tables and schemas
between catalogs
([#756](#756)).
* Added functionality to determine migration method based on DBFS Root
([#759](#759)).
* Added `get_tables_to_migrate` functionality in the mapping module
([#755](#755)).
* Added retry and rate limit to rename workspace group operation and
corrected rate limit for reflecting account groups to workspace
([#751](#751)).
* Adopted `databricks-labs-blueprint` library for common utilities to be
reused in the other projects
([#758](#758)).
* Converted `RuntimeBackend` query executions exceptions to SDK
exceptions ([#769](#769)).
* Fixed issue with missing users and temp groups after workspace-local
groups migration and skip table when crawling table size if it does not
exist anymore ([#770](#770)).
* Improved error handling by not failing group rename step if a group
was removed from account before reflecting it to workspace
([#762](#762)).
* Improved error message inference from failed workflow runs
([#753](#753)).
* Moved `TablesMigrate` to a separate module
([#747](#747)).
* Reorganized assessment dashboard to increase readability
([#738](#738)).
* Updated databricks-sdk requirement from ~=0.16.0 to ~=0.17.0
([#773](#773)).
* Verify metastore exists in current workspace
([#735](#735)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert to SDK exceptions for RuntimeBackend query executions

2 participants