Policy Generator (Python) has problems
[!NOTE] In the original version of this issue, I mistakenly referred to
policy_explorerwhen I meantpolicy_generator. The corrected version appears below.
Describe the bug
policy_generator.py is reporting an error
Traceback (most recent call last):
File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/policy_generator.py", line 388, in <module>
main()
~~~~^^
File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/policy_generator.py", line 382, in main
imp = csv_analyzer.drop_col_feature_importance(df, "outcome")
File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/csv_analyzer.py", line 306, in drop_col_feature_importance
X2, y = _prepare_data(df, target)
~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/csv_analyzer.py", line 277, in _prepare_data
raise KeyError(f"Column '{target}' not found in {list(df.columns)}")
KeyError: "Column 'outcome' not found in ['ssvc_e_1_0_0', 'ssvc_exp_1_0_1', 'ssvc_a_2_0_0', 'ssvc_hi_2_0_0', 'ssvc_dsoi_1_0_0']"
To Reproduce Steps to reproduce the behavior:
- Run
policy_generator.py - Witness error
Expected behavior
Should run without errors.
Additional context
It's unclear whether we really still need policy_generator.py now that we have the DecisionTable class. So the first decision to make here is whether to just get rid of it entirely, or maybe refactor it to use the more recent DecisionTable class.
A second decision is what to rename this since we're trying to avoid confusion on the use of the term "policy" (so probably rename to Decision Table Generator or somesuch).
This is for the Deployer Patch Application table.
To be clear - this is specific to Javascript Explorer and NOT the Python policy explorer. There is a little zoom control on the top left corner that may help. But we can also do a Javascript post displayed div mutation to adjust div height. I will split this into a new issue.
Apologies, I typed explorer when I meant generator in the original description. Corrected that now.