Skip to content

Fix KeyError when log event is missing 'level' key in TriggerRunner#66060

Draft
Srujan-rai wants to merge 1 commit into
apache:mainfrom
Srujan-rai:main
Draft

Fix KeyError when log event is missing 'level' key in TriggerRunner#66060
Srujan-rai wants to merge 1 commit into
apache:mainfrom
Srujan-rai:main

Conversation

@Srujan-rai
Copy link
Copy Markdown

Triggerer subprocess log reader called event.pop("level") without a
default, raising KeyError when a structlog event omits the "level" field.
Changed to event.pop("level", "warning") so missing-level events are
logged at WARNING instead of crashing the log processing loop.

Added tests covering missing level, unknown level, and valid level paths.

Triggerer subprocess log reader called `event.pop("level")` without a
default, raising KeyError when a structlog event omits the "level" field.
Changed to `event.pop("level", "warning")` so missing-level events are
logged at WARNING instead of crashing the log processing loop.

Added tests covering missing level, unknown level, and valid level paths.
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 29, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk potiuk marked this pull request as draft May 18, 2026 08:54
@potiuk
Copy link
Copy Markdown
Member

potiuk commented May 18, 2026

@Srujan-rai This PR has been converted to draft because the Core...Serialization test suite is failing across every database backend (Postgres, MySQL, SQLite, and the LowestDeps matrix), which indicates the change has broken serialization logic — see our Pull Request quality criteria.

Issues found:

  • Core serialization tests failing on all DBs:

    • Postgres tests: core / DB-core:Postgres:14:3.10:Core...Serialization — failure
    • MySQL tests: core / DB-core:MySQL:8.0:3.10:Core...Serialization — failure
    • Sqlite tests: core / DB-core:Sqlite:3.10:Core...Serialization — failure
    • Low dep tests:core / All-core:LowestDeps:14:3.10:Core...Serialization — failure

    The failure being symmetric across all DB backends means it is not flaky CI — the test code itself is failing against the PR's change. Likely the new KeyError guard interacts with how triggerer log records are serialized. Reproduce locally with:

    breeze testing core-tests --test-types Core --backend sqlite -- -k serialization
    

    See the testing docs.

What to do next:

  • Run the serialization tests locally, fix the regression, push.
  • Mark the PR as "Ready for review" when CI is green.

Converting a PR to draft is not a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. No rush — take your time. If you have questions, feel free to ask on the Airflow Slack.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants