KamranImaaz opened a new pull request, #60628:
URL: https://github.com/apache/airflow/pull/60628
Fix #60627
This PR improves the error handling of the `BigQueryGetDatasetOperator` in
`bigquery.py` for two common failure scenarios:
Authentication failure (`DefaultCredentialsError`)
Dataset not found (`NotFound`)
Currently, when either of these errors occurs, the operator raises raw
Google exceptions, resulting in long, verbose stack traces that make it harder
for users to quickly identify the cause.
This PR wraps these exceptions with clear `AirflowException` messages to
provide concise, user-friendly feedback.
**Changes**
Catch `DefaultCredentialsError` and raise:
AirflowException("Could not get dataset, no valid Google Cloud credentials
were found.")
Catch `NotFound` exception and raise:
AirflowException(f"Dataset {self.dataset_id} not found in project
{self.project_id}.")
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]