Skip to content

Validate Pareto directions before empty result#2792

Merged
FlorianPfaff merged 2 commits into
mainfrom
fix-pareto-empty-direction-validation
Jun 23, 2026
Merged

Validate Pareto directions before empty result#2792
FlorianPfaff merged 2 commits into
mainfrom
fix-pareto-empty-direction-validation

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • Validate pareto_front_indices objective directions before taking the empty-table fast path.
  • Add a regression test showing invalid directions are rejected even when the input table has no rows.

Bug

Before this change, pareto_front_indices() returned [] for an empty table before validating directions, so invalid directions such as "sideways" were silently accepted. This was inconsistent with is_pareto_front() and with non-empty Pareto calls.

Testing

  • Added focused regression test in tests/evaluation/test_pareto_empty_validation.py.
  • Not run locally; this environment cannot clone GitHub or install the repository dependencies, so CI should run the regression test on the PR.

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 56.51s
✅ JSON prettier 7 0 0 0 1.2s
✅ JSON v8r 7 0 0 5.27s
✅ MARKDOWN markdownlint 68 0 0 0 1.74s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.82s
✅ PYTHON black 891 10 0 0 56.26s
✅ PYTHON isort 891 11 0 0 3.75s
✅ REPOSITORY checkov yes no no 48.46s
✅ REPOSITORY gitleaks yes no no 9.59s
✅ REPOSITORY git_diff yes no no 0.08s
✅ REPOSITORY secretlint yes no no 26.14s
✅ REPOSITORY syft yes no no 5.21s
✅ REPOSITORY trivy-sbom yes no no 7.96s
✅ REPOSITORY trufflehog yes no no 25.1s
✅ YAML prettier 11 0 0 0 0.73s
✅ YAML v8r 11 0 0 12.26s
✅ YAML yamllint 11 0 0 0.51s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.5.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff FlorianPfaff merged commit fcd098d into main Jun 23, 2026
26 checks passed
@FlorianPfaff FlorianPfaff deleted the fix-pareto-empty-direction-validation branch June 23, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant