fix: write GML without explicit vertex IDs - #2745
Conversation
|
LGTM if CI is green |
|
Working on fixing checks on main, let's merge main into this branch when done to get it green. |
SummaryMerged the current Thanks to maintainersThanks for reviewing the fix and for the guidance on when to refresh the branch. Issue or motivationThe branch was seven commits behind Root causeThe previous PR checks ran against the older base at ChangeMerged Tests
ScopeThis update only syncs the PR with |
|
Quick follow-up on the CI gate: the PR is still mergeable and the GML patch is unchanged after the requested Could a maintainer approve or re-run those workflows when convenient? I’m happy to refresh the branch again if the current base requires it. |
Summary
Allow
write_graph(..., format = "gml")to use the GML writer's default vertex IDs whenidis omitted. Fixes #2710.Thanks to maintainers
Thanks for triaging the report, requesting a regression test, and pointing out that the branch should be refreshed after the main-branch check fixes.
Issue or motivation
Writing a graph as GML currently fails unless the caller supplies one ID per vertex. Earlier versions generated node IDs when none were supplied, and the C writer still supports that path.
Root cause
Stimulus treated the C writer's nullable
idpointer as a required vector. The generated R wrapper convertedNULLtonumeric(0), so C received an empty vector instead of a null pointer and rejected its length.Change
Mark
idas optional in the Stimulus metadata and regenerate the R/C interface layers. The added regression test writes a graph without IDs and reads it back to confirm graph isomorphism. This branch is also merged with currentmain(b06aeb7e).Tests
air format --check .test-foreign.R: 18 passed, 0 failed, 0 warningstestthat::test_local(reporter = "check", stop_on_failure = TRUE): 9208 passed, 0 failed, 3 skippedR CMD build: succeeded, including vignette creationR CMD check --no-manual: package tests and vignette rebuild passed; local status is2 WARNINGsfrom vendored GLPK/compiler diagnostics, with no errors or notesrcc:action_required; no jobs or logs were created yetScope
This does not change explicit IDs, other graph writers, GML serialization details, vendored GLPK, or unrelated lifecycle/CI behavior.
I used AI assistance to help check for issues, refine the code, and run tests.
I'm fine with GPL 2 or later and FDL.