nv-morpheus / Morpheus

Morpheus SDK
Apache License 2.0
309 stars 119 forks source link

[BUG]: undefined variable error in `examples/log_parsing/postprocessing.py` #1765

Open dagardner-nv opened 1 week ago

dagardner-nv commented 1 week ago

Version

24.06

Which installation method(s) does this occur on?

Source

Describe the bug.

In LogParsingPostProcessingStage::__get_label_dicts there is a possibility that the new_label and new_confidence variables are undefined.

The code defines these inside an if block inside of a for-loop, and assumes one of two situations is true: 1) The if statement evaluated to True and are defined 2) The if statement evaluated to False but the variables were defined in a previous iteration of the loop.

There are situations where neither of the above are true and the code fails. This was encountered recently parsing a new dataset that was not in the format expected.

We should either (or both):

Minimum reproducible example

No response

Relevant log output

Click here to see error details

 [Paste the error here, it will be hidden by default]

Full env printout

Click here to see environment details

 [Paste the results of print_env.sh here, it will be hidden by default]

Other/Misc.

No response

Code of Conduct