geraj1010 opened a new pull request, #48466:
URL: https://github.com/apache/airflow/pull/48466

   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #46923 
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   
   ---
   Created new exception `DbtCloudJobRunDetailsException`, which surfaces the 
job run logs from dbt Cloud, whenever a job run fails or is cancelled.
   
   Current Task Log Output
   `... 
   File "/opt/airflow/airflow/providers/dbt/cloud/operators/dbt.py", line 182, 
in execute raise DbtCloudJobRunException(f"Job run {self.run_id} has failed or 
has been cancelled.") 
airflow.providers.dbt.cloud.hooks.dbt.DbtCloudJobRunException: Job run 
70471831332476 has failed or has been cancelled. `
   
   New Task Log Output
   `... 
   File "/opt/airflow/airflow/providers/dbt/cloud/operators/dbt.py", line 187, 
in execute raise DbtCloudJobRunDetailsException(self.run_id, run_details) 
airflow.providers.dbt.cloud.hooks.dbt.DbtCloudJobRunDetailsException: Job run 
70471831584850 has failed or has been cancelled. Job run details: {"id": 
70471831584850, "job_id": 70471823442042, "is_error": true, "dbt_version": 
"latest", "finished_at": "2025-03-27 20:37:19.996618+00:00", 
"finished_at_humanized": "30 seconds ago", "run_duration": "00:00:28", 
"run_duration_humanized": "28 seconds"} Run step details: {"run_id": 
70471831584850, "id": 70471865832299, "index": 1, "name": "Clone git 
repository", "status": 10, "status_humanized": "Success", "duration": 
"00:00:00", "duration_humanized": "0 minutes", "logs": "Cloning into 
'/tmp/jobs/70471831584850/target'...\nSuccessfully cloned repository.\nChecking 
out default branch\n", "debug_logs": ""}{"run_id": 70471831584850, "id": 
70471865832302, "index": 2, "name": "Create profile from 
 connection BigQuery", "status": 10, "status_humanized": "Success", "duration": 
"00:00:00", "duration_humanized": "0 minutes", "logs": "Create profile from 
connection BigQuery", "debug_logs": ""}{"run_id": 70471831584850, "id": 
70471865832303, "index": 3, "name": "Invoke dbt with ``dbt deps``", "status": 
10, "status_humanized": "Success", "duration": "00:00:02", 
"duration_humanized": "2 seconds", "logs": "20:36:59  Running dbt...\n20:36:59  
Warning: No packages were found in packages.yml\n20:36:59  Warning: No packages 
were found in packages.yml\n", "debug_logs": ""}{"run_id": 70471831584850, 
"id": 70471865832306, "index": 4, "name": "Invoke dbt with dbt build", 
"status": 20, "status_humanized": "Error", "duration": "00:00:14", 
"duration_humanized": "14 seconds", "logs": "dbt command failed20:37:01  
Running dbt...\n20:37:03  Found 2 models, 4 data tests, 492 macros\n20:37:03  
\n20:37:03\n20:37:03  Concurrency: 4 threads (target='default')\n20:37:03  
\n20:37:03  1 of 6 START sql table
  model dbt.my_first_dbt_model ..................... [RUN]\n20:37:07  1 of 6 OK 
created sql table model dbt.my_first_dbt_model ................ 
[\u001b[32mCREATE TABLE (2.0 rows, 0 processed)\u001b[0m in 3.35s]\n20:37:07  2 
of 6 START test not_null_my_first_dbt_model_id ............................... 
[RUN]\n20:37:07  3 of 6 START test unique_my_first_dbt_model_id 
................................. [RUN]\n20:37:08  2 of 6 FAIL 1 
not_null_my_first_dbt_model_id ................................... 
[\u001b[31mFAIL 1\u001b[0m in 1.17s]\n20:37:08  3 of 6 PASS 
unique_my_first_dbt_model_id ....................................... 
[\u001b[32mPASS\u001b[0m in 1.31s]\n20:37:08  4 of 6 SKIP relation 
dbt.my_second_dbt_model ............................ 
[\u001b[33mSKIP\u001b[0m]\n20:37:08  5 of 6 SKIP test 
not_null_my_second_dbt_model_id ............................... 
[\u001b[33mSKIP\u001b[0m]\n20:37:08  6 of 6 SKIP test 
unique_my_second_dbt_model_id ................................. [\u001b[33mSKI
 P\u001b[0m]\n20:37:08  \n20:37:08\n20:37:08  Finished running 1 table model, 4 
data tests, 1 view model in 0 hours 0 minutes and 5.26 seconds 
(5.26s).\n20:37:08  \n20:37:08\n20:37:08  \u001b[31mCompleted with 1 error, 0 
partial successes, and 0 warnings:\u001b[0m\n20:37:08  \n20:37:08\n20:37:08  
\u001b[31mFailure in test not_null_my_first_dbt_model_id 
(models/example/schema.yml)\u001b[0m\n20:37:08\n20:37:08    Got 1 result, 
configured to fail if != 0\n20:37:08  \n20:37:08\n20:37:08    compiled code at 
target/compiled/airflow_dbt_providers_test/models/example/schema.yml/not_null_my_first_dbt_model_id.sql\n20:37:08
  \n20:37:08\n20:37:08  Done. PASS=2 WARN=0 ERROR=1 SKIP=3 NO-OP=0 TOTAL=6\n", 
"debug_logs": ""} 
   `


-- 
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]

Reply via email to