Skip to content

Remove dead :unions_with_bind render branch#11

Open
alexskr wants to merge 1 commit into
mainfrom
remove-dead-unions-with-bind
Open

Remove dead :unions_with_bind render branch#11
alexskr wants to merge 1 commit into
mainfrom
remove-dead-unions-with-bind

Conversation

@alexskr

@alexskr alexskr commented Jun 23, 2026

Copy link
Copy Markdown
Member

What

Removes the unreachable :unions_with_bind (non-optional) render branch from Query#to_s in lib/sparql/client/query.rb.

Why

The branch was dead code. Its DSL writer (union_with_bind_as) was dropped during an earlier reset-to-upstream + manual reapply of NCBO customizations, which kept optional_union_with_bind_as but dropped the inline setter — leaving the render branch orphaned with no way to populate options[:unions_with_bind]. A dead branch that still looks functional is a maintenance trap.

Scope / safety

  • Pure dead-code removaloptions[:unions_with_bind] has no writer in any active lineage, so no query the stack emits can reach this branch. Query output is unchanged.
  • Verified unused across all active downstream consumers: ncbo/goo, ontoportal/goo, and the AgroPortal/LIRMM ontoportal-lirmm-development branch all call only optional_union_with_bind_as.
  • Retained: the live :optional_unions_with_bind path and the shared add_union_with_bind helper it depends on.

Not in scope (deliberately deferred)

The escaping hardening (route add_union_with_bind interpolation through serialize_uri/serialize_value) and the buffer.pop guard touch the live optional path and should land as a separate change with its own test coverage.

🤖 Generated with Claude Code

The non-optional `:unions_with_bind` branch in `Query#to_s` was
unreachable: its DSL writer (`union_with_bind_as`) was dropped during an
earlier reset-to-upstream + manual reapply, leaving the render branch
orphaned with no way to populate `options[:unions_with_bind]`.

Confirmed unused across all active downstream lineages (ncbo/goo,
ontoportal/goo, and the AgroPortal/LIRMM `ontoportal-lirmm-development`
branch) — every consumer calls only `optional_union_with_bind_as`.

This is a pure dead-code removal; query output is unchanged. The live
`:optional_unions_with_bind` path and the shared `add_union_with_bind`
helper it relies on are retained.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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