-
Notifications
You must be signed in to change notification settings - Fork 16.3k
feat: Refactor Databricks error handling with utility functions #52704
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
Merged
potiuk
merged 1 commit into
apache:main
from
gaurav7261:chore/databricks_error_code_restructure
Jul 24, 2025
Merged
feat: Refactor Databricks error handling with utility functions #52704
potiuk
merged 1 commit into
apache:main
from
gaurav7261:chore/databricks_error_code_restructure
Jul 24, 2025
Conversation
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
1ceccc4 to
231ca15
Compare
prdai
reviewed
Jul 2, 2025
providers/databricks/src/airflow/providers/databricks/utils/databricks.py
Show resolved
Hide resolved
prdai
approved these changes
Jul 2, 2025
Contributor
Author
|
@Programmer-RD-AI who will merge this? |
Contributor
|
@gaurav7261 i think a maintainer needs to approve and merge this, i am just a contributor so i do not have access to merge... |
Contributor
Author
|
@Lee-W can you please check this |
Contributor
Author
|
@Lee-W can you review this please |
- Extract failed task error handling into reusable utility functions - Add extract_failed_task_errors() for synchronous operations - Add extract_failed_task_errors_async() for asynchronous operations - Update DatabricksNotebookOperator to use new utility functions - Update DatabricksExecutionTrigger to use async utility functions - Replace duplicate error extraction code across operators and triggers - Add comprehensive test cases for both sync and async error extraction - Improve error handling consistency across Databricks provider components
231ca15 to
81c9224
Compare
potiuk
approved these changes
Jul 24, 2025
ferruzzi
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Aug 7, 2025
…he#52704) - Extract failed task error handling into reusable utility functions - Add extract_failed_task_errors() for synchronous operations - Add extract_failed_task_errors_async() for asynchronous operations - Update DatabricksNotebookOperator to use new utility functions - Update DatabricksExecutionTrigger to use async utility functions - Replace duplicate error extraction code across operators and triggers - Add comprehensive test cases for both sync and async error extraction - Improve error handling consistency across Databricks provider components Co-authored-by: gaurav miglani <gauravmiglani@ip-10-101-16-156.ap-south-1.compute.internal>
fweilun
pushed a commit
to fweilun/airflow
that referenced
this pull request
Aug 11, 2025
…he#52704) - Extract failed task error handling into reusable utility functions - Add extract_failed_task_errors() for synchronous operations - Add extract_failed_task_errors_async() for asynchronous operations - Update DatabricksNotebookOperator to use new utility functions - Update DatabricksExecutionTrigger to use async utility functions - Replace duplicate error extraction code across operators and triggers - Add comprehensive test cases for both sync and async error extraction - Improve error handling consistency across Databricks provider components Co-authored-by: gaurav miglani <gauravmiglani@ip-10-101-16-156.ap-south-1.compute.internal>
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.
Refactor Databricks error handling with reusable utility functions
Problem
The Databricks provider currently has duplicate error extraction logic scattered across multiple operators and triggers:
DatabricksNotebookOperator.monitor_databricks_job()DatabricksRunNowOperator.execute_complete()DatabricksExecutionTrigger.run()This duplication leads to:
Solution
This PR introduces two new utility functions in
databricks/utils/databricks.py:1.
extract_failed_task_errors()- Synchronous versionDatabricksNotebookOperator2.
extract_failed_task_errors_async()- Asynchronous versionDatabricksExecutionTriggerChanges Made
DatabricksNotebookOperator.monitor_databricks_job()to use new utilitiesDatabricksExecutionTrigger.run()to use async utilitiesTesting
Added comprehensive test coverage in
tests/unit/databricks/utils/test_databricks.py:Benefits
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.