This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 19da2816304 Dev: Fix KeyError in release issue content generation 
(#52751)
19da2816304 is described below

commit 19da28163042a2a4924d905cdb81c22857486c73
Author: Kaxil Naik <[email protected]>
AuthorDate: Thu Jul 3 11:51:39 2025 +0530

    Dev: Fix KeyError in release issue content generation (#52751)
    
    When generating issue content for releases, some PRs were being filtered out
    during processing (e.g., dependabot PRs, doc-only PRs) but still remained in
    the `pull_requests` dictionary. This caused a `KeyError` when the Jinja2 
template
    tried to access `user_logins` for PRs that had no corresponding user data.
    
    The fix ensures that `pr_list` variable only contains PRs that have 
corresponding entries
    in the users dictionary, preventing the template from accessing undefined 
keys.
    
    Fixes issue where `breeze release-management generate-issue-content-core`
    command failed with "UndefinedError: dict object has no element 
<PR_NUMBER>".
---
 dev/breeze/src/airflow_breeze/commands/release_management_commands.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py 
b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index 016cc702505..b9eb87f9394 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -2633,7 +2633,8 @@ def print_issue_content(
     if is_helm_chart:
         link = 
f"https://dist.apache.org/repos/dist/dev/airflow/{current_release}";
         link_text = f"Apache Airflow Helm Chart 
{current_release.split('/')[-1]}"
-    pr_list = sorted(pull_requests.keys())
+    # Only include PRs that have corresponding user data to avoid KeyError in 
template
+    pr_list = sorted([pr for pr in pull_requests.keys() if pr in users])
     user_logins: dict[int, str] = {pr: " ".join(f"@{u}" for u in uu) for pr, 
uu in users.items()}
     all_users: set[str] = set()
     for user_list in users.values():

Reply via email to