Skip to main content
Panther Knowledge Base

How do I resolve the PAT error "name 'Optional' is not defined"?

Issue

When trying to merge our repo with Panther upstream, the following error occurs with my PAT tests:

name 'Optional' is not defined

 

Resolution

To resolve this issue:

  1. Verify that you are using the most current versions of panther-analysis-tool and panther-analysis . If not, please upgrade and try merging again.
  2. Make sure you are using a recent version of Python, as Optional was added relatively recently. If you’re using pipenv, it should manage the update for you.
  3. Run make install from the panther-analysis root to obtain the correct panther-analysis-tool dependency.

Cause

This Python error occurs when from typing import Optional is not set correctly. Running the make install command ensures that you incorporate any new dependencies we've added, such as detection helpers.

 

 

  • Was this article helpful?