How to fix "TypeError: 'type' object is not subscriptable" when uploading to my Panther repo
Last updated: September 3, 2024
Issue
I'm using a CI/CD workflow, where my detections are stored in a git repo, and I upload the detections to Panther with Panther Analysis Tool (PAT). When I try uploading, I get the following error:
TypeError: 'type' object is not subscriptableResolution
To resolve this issue:
Upgrade your local Python installation to 3.9 or higher
Reinstall PAT with the new Python version.
Cause
This issue occurs due to an incompatibility between the "standard" type hinting, introduced in Python 3.9, and earlier versions. In 3.9+, you can use type hints like list[int], whereas in earlier Python versions, you'd need to specify typing.List[int].