Skip to content

chore: remove obsolete FIXME comments from bipartite tests - #15107

Open
dwaddle wants to merge 1 commit into
TheAlgorithms:masterfrom
dwaddle:fix-check-bipartite-errors
Open

chore: remove obsolete FIXME comments from bipartite tests#15107
dwaddle wants to merge 1 commit into
TheAlgorithms:masterfrom
dwaddle:fix-check-bipartite-errors

Conversation

@dwaddle

@dwaddle dwaddle commented Aug 28, 2026

Copy link
Copy Markdown

Describe your change:

Removed 4 obsolete FIXME comments from graphs/check_bipatrite.py that were left behind in a previous PR (#10708). The bugs they referenced (KeyError and TypeError) were already fixed at that time by migrating to a defaultdict and adding node existence checks, making these FIXME comments and tracebacks redundant. No functional code or tests were changed.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper Bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Aug 28, 2026
@cclauss

cclauss commented Sep 7, 2026

Copy link
Copy Markdown
Member

@priya-sundaram-dev, your review. please. Compare with #15210 (review)

@priya-sundaram-dev priya-sundaram-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed, @cclauss — this one is a clean approve from me, and it's a nice contrast with #15210.

Both PRs target the same FIXME comments in check_bipatrite.py, but they take opposite approaches:

  • #15210 deleted the guards (if node not in graph: ...) that the FIXMEs sat next to. As I noted there, those guards are load-bearing — they make an ordinary adjacency dict where a node appears as a neighbor but is omitted as a key (a sink with no out-edges) work correctly. Removing them breaks 13 existing doctests and CI goes red.
  • #15107 deletes only the comments, leaving the working code untouched.

That's the right call, because the FIXMEs were simply wrong: they claimed the adjacent doctests "should fail with KeyError / TypeError", but those inputs are handled gracefully and the doctests already assert the correct False/True results. So the comments were stale/misleading, not a real TODO. Removing them is documentation cleanup with zero behavior change.

Verified locally on this branch: pure deletions (no code touched), and python -m doctest graphs/check_bipatrite.py30 passed, 0 failed. CI here is green across build / build_docs / ruff / pre-commit.

LGTM. 👍 If we want to also honor the literal ask in #15127 (let invalid graphs raise), that's a separate design decision — it would need the doctests rewritten to # doctest: +IGNORE_EXCEPTION_DETAIL style expected-exception blocks — and shouldn't block this cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants