Skip to content

Fix stringified nulls in UID mapping#38

Open
Chryseisliu wants to merge 1 commit into
mainfrom
fix/stringified-null-uid-mapping
Open

Fix stringified nulls in UID mapping#38
Chryseisliu wants to merge 1 commit into
mainfrom
fix/stringified-null-uid-mapping

Conversation

@Chryseisliu

Copy link
Copy Markdown
Collaborator

Description

Fixes a UID mapping bug where cached null values reloaded as strings (for example "None", "nan", "<NA>") were treated as real Reactome/entity IDs. This caused fake string-null IDs to propagate into UID indexing and downstream stable-ID exports.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement (refactoring, performance, etc.)

Related Issue

N/A

Changes Made

  • Added _is_missing_value() to consistently detect real nulls and stringified null values.
  • Updated UID mapping/index logic so stringified nulls are not treated as valid terminal entity IDs.
  • Added regression coverage for stringified-null UID mapping behavior.

Testing

Unit Tests

  • All existing unit tests pass locally (poetry run pytest tests/ -v -m "not database")
  • Added new unit tests for changes (if applicable)

Targeted test run:

python -m pytest tests/test_logic_network_generator.py -q

Result:

21 passed in 1.66s

Manual Testing

Describe any manual testing performed:

  • Tested with pathway ID(s): N/A for this PR; covered by unit regression.
  • Verified output files: N/A.

Code Quality

  • Code follows project style guidelines (ruff)
  • Ran poetry run ruff check src/ with no errors
  • Ran poetry run ruff format src/
  • Type hints added/updated where applicable
  • Ran poetry run mypy --ignore-missing-imports src/ (optional)

Documentation

  • Updated README.md (if needed)
  • Added/updated docstrings
  • Updated relevant documentation in docs/

Checklist

  • Self-review completed
  • Code is well-commented, particularly in complex areas
  • No debugging code left in (print statements, breakpoints, etc.)
  • No credentials or sensitive information in code
  • Git commit messages are clear and descriptive

Screenshots (if applicable)

N/A

@Chryseisliu Chryseisliu force-pushed the fix/stringified-null-uid-mapping branch from a2399e5 to 5ef99a3 Compare June 22, 2026 08:55
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