mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-07 12:07:43 +00:00
fix(security): resolve path-injection, B701, B101, B112 Bandit alerts
- Path injection (B614): centralized safe_resolve_path in core/utils.py, refactored 6 UI modules to use it with safe_root validation - B701: added explicit autoescape=select_autoescape() to Jinja2 Environment() calls in 3 files - B101: replaced assert statements with proper if/raise patterns in 12+ files (partial) - B112: added logger.warning() to bare except:continue blocks in 5 files
This commit is contained in:
+6
-5
@@ -25,11 +25,12 @@ def prepare(raw: Path, public: Path, private: Path):
|
||||
new_test.to_csv(public / "test.csv", index=False)
|
||||
|
||||
# Checks
|
||||
assert new_test.shape[1] == 12, "Public test set should have 12 columns"
|
||||
assert new_train.shape[1] == 13, "Public train set should have 13 columns"
|
||||
assert len(new_train) + len(new_test) == len(
|
||||
old_train
|
||||
), "Length of new_train and new_test should equal length of old_train"
|
||||
if new_test.shape[1] != 12:
|
||||
raise AssertionError("Public test set should have 12 columns")
|
||||
if new_train.shape[1] != 13:
|
||||
raise AssertionError("Public train set should have 13 columns")
|
||||
if len(new_train) + len(new_test) != len(old_train):
|
||||
raise AssertionError("Length of new_train and new_test should equal length of old_train")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user