Skip to content

fix: Fix KeyError on missing columns in cloudlets retrieve history#39

Open
wisicn wants to merge 1 commit into
akamai:masterfrom
wisicn:fix/retrieves-shared-er-policy
Open

fix: Fix KeyError on missing columns in cloudlets retrieve history#39
wisicn wants to merge 1 commit into
akamai:masterfrom
wisicn:fix/retrieves-shared-er-policy

Conversation

@wisicn

@wisicn wisicn commented Apr 14, 2026

Copy link
Copy Markdown

When running akamai cloudlets retrieve --policy-id <id> --version <v>, the command crashed with KeyError: "['lock', 'last editor', 'notes'] not in index" because history_df[history_columns] fails if those columns don't exist in the API response DataFrame.

Replace history_df[history_columns] with
history_df.reindex(columns=history_columns, fill_value='') in both the standard policy and shared policy code paths. Missing columns are now filled with empty strings and displayed as empty cells in the output table, instead of causing a crash.

Files changed:

  • bin/akamai-cloudlets.py (2 locations)

When running `akamai cloudlets retrieve --policy-id <id> --version <v>`,
the command crashed with `KeyError: "['lock', 'last editor', 'notes'] not in index"`
because `history_df[history_columns]` fails if those columns don't exist
in the API response DataFrame.

Replace `history_df[history_columns]` with
`history_df.reindex(columns=history_columns, fill_value='')` in both
the standard policy and shared policy code paths. Missing columns are
now filled with empty strings and displayed as empty cells in the
output table, instead of causing a crash.

Files changed:
- bin/akamai-cloudlets.py (2 locations)
@pwongcha pwongcha self-assigned this Apr 15, 2026
@pwongcha pwongcha added the bug Something isn't working label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants