You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2026/07/23 11:29:07 UTC

[PR] Highlight user-code frames in task log tracebacks [airflow]

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

   When a task fails, the frame that actually raised is almost always in the user's DAG code, but in the log traceback it looks identical to the surrounding framework frames from installed packages — so you have to scan every `File "..."` line to find where your code is.
   
   This colors traceback frames by origin: frames in **user code** (DAG bundle, plugins, local files) stay prominent (`fg.info`, bold), while frames in installed packages (`site-packages` / `dist-packages`) are muted (`fg.muted`). The failing user frame now stands out at a glance.
   
   Classification is a single rule — a frame is user code unless its path is under a `site-packages`/`dist-packages` directory — which is robust across bundle layouts (local folder, git, `/tmp/airflow/dag_bundles/...`) without hardcoding a bundle path. A `data-frame-source` attribute (`user`/`library`) is set on each frame for testability and as a styling hook.
   
   Before / after:
   
   - Before (all frames same color): _screenshot placeholder_
   - After (user-code frame highlighted, site-packages muted): _screenshot placeholder_
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Highlight user-code frames in task log tracebacks [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #70294:
URL: https://github.com/apache/airflow/pull/70294#issuecomment-5059928564

   How does this look in dark mode? 
   
   How different do we want these links to look like? fg.info vs fg.muted in light mode is fairly subtle. 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Highlight user-code frames in task log tracebacks [airflow]

Posted by "collinmcnulty (via GitHub)" <gi...@apache.org>.
collinmcnulty commented on PR #70294:
URL: https://github.com/apache/airflow/pull/70294#issuecomment-5060318552

   The pieces I really want in color are the parts that are my code (so not site-packages and not airflow itself) and the actual error message (ParserError in this case). There's so much blue on the screen that its actually hard to pick those out. I think it would be fine to put the site-packages lines just in the normal black text color.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Highlight user-code frames in task log tracebacks [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #70294:
URL: https://github.com/apache/airflow/pull/70294


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Highlight user-code frames in task log tracebacks [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #70294:
URL: https://github.com/apache/airflow/pull/70294#issuecomment-5060343021

   That makes sense to me, system file lines aren't important so we should reduce their highlight or remove it entirely


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Highlight user-code frames in task log tracebacks [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #70294:
URL: https://github.com/apache/airflow/pull/70294#issuecomment-5068321127

   ### Backport successfully created: v3-3-test
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
   
   In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
           <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>✅</td>
           <td>v3-3-test</td>
           <td><a href="https://github.com/apache/airflow/pull/70375"><img src="https://img.shields.io/badge/PR-70375-blue" alt="PR Link"></a></td>
       </tr>
   </table>


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Highlight user-code frames in task log tracebacks [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #70294:
URL: https://github.com/apache/airflow/pull/70294#issuecomment-5061308503

   Updated. Now library line appear in normal text color:
   
   <img width="1939" height="875" alt="Screenshot 2026-07-23 at 19 16 27" src="https://github.com/user-attachments/assets/ba7dca5e-5a21-4f99-831a-0e727e177a98" />
   <img width="1918" height="927" alt="Screenshot 2026-07-23 at 19 16 58" src="https://github.com/user-attachments/assets/18d46410-eb51-4822-b67e-38eebc06ced7" />
   
   
   Here airflow is considered 'user code' because that's a local development setup where airflow is actually installed in editable mode from source. Normally in prod environment it will be 'pip installed...' and land in site packages.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Highlight user-code frames in task log tracebacks [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #70294:
URL: https://github.com/apache/airflow/pull/70294#issuecomment-5068308349

   On a real install. With airflow installed from a wheel:
   
   <img width="1296" height="714" alt="Screenshot 2026-07-24 at 11 28 33" src="https://github.com/user-attachments/assets/938aab33-efda-426e-a1c2-18133b997ff0" />
   <img width="1546" height="815" alt="Screenshot 2026-07-24 at 11 28 52" src="https://github.com/user-attachments/assets/8c3113d4-a337-4e61-8ef8-445a8f8b0622" />
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org