Repository navigation
Conversation
nodes() and edges() only forward extra positional/keyword arguments when the data argument is a callable. For a DataFrame they were silently dropped, so e.g. graphistry.nodes(df, 'id', point_title='c') left point_title unbound. Raise TypeError naming the unexpected arguments, and suggest .bind(...) when a keyword is a binding name. test_hop_column_conflicts_solution passed src_renamed/dst_renamed to edges(), which were ignored; drop them so the test keeps its intent. Refs graphistry#398
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs, notCloses— only the first checklist item of [FEA] move more bindings to nodes()/edges() and stronger binding error checking #398 is addressed)Problem
nodes()/edges()only forward extra positional/keyword arguments when the data argument is a callable. When given a DataFrame (or any other non-callable), extra arguments were silently dropped. For example,graphistry.nodes(df, 'id', point_title='some_col')succeeded but leftpoint_titleunbound.Change
PlotterBase.nodes()/PlotterBase.edges()with non-callable data now raiseTypeErrornaming the unexpected positional and/or keyword arguments.bind()binding name (e.g.point_title,edge_title), the message suggests using.bind(...)instead. Misspelled / unknown names do not get that hint.bind()are unchanged. Formal parameters such asnode=,source=,destination=,edge=are unaffected, as isnodes(None).graphistry.nodes()/graphistry.edges()delegate toPlotterBase, so they behave the same; both entry points are tested.Calls that previously silently ignored extra arguments now raise
TypeError. This is recorded under### Breaking 🔥in the[Development]section ofCHANGELOG.md.Evidence that existing code relied on the silent behavior:
graphistry/tests/compute/test_hop_column_conflicts_solution.pycalled.edges(edges_df, 'src', 'dst', src_renamed='id', dst_renamed='id').edges()has no such parameters, so they were silently dropped. Unmodified, this test now fails withedges() got unexpected keyword argument(s) 'src_renamed', 'dst_renamed'. In this PR only those two arguments were removed (and an inaccurate comment on that line corrected); the test's intent is unchanged and it passes on both base and head. A repo-wide search for keyword calls to.nodes(...)/.edges(...)found no other such usages, and no other existing test changed outcome.Non-goals
Validation
Local results (Python 3.12,
pip install -e .[test]):TestNodesEdgesExtraArgsingraphistry/tests/test_plotter.py(11 tests, covering bothPlotterBaseand module-level entry points): on base0b6f88d88 failed / 3 passed; on this branch 11 passed.bin/test-minimal.shplus the GFQL tests (modules requiring optional dependencies or network skipped):bin/lint.sh: passbin/typecheck.sh(mypy): passNote
Extra positional arguments are shown via
reprin the error message, which can be long if a DataFrame is passed positionally. Happy to truncate or adjust the message if you prefer.Cypher Frontend CI Evidence (when PR touches cypher frontend / IR scope)
N/A — this PR does not touch the cypher frontend / IR scope.
AI disclosure: This change was produced with AI assistance (implementation and tests), then independently reviewed and tested by a separate AI review step before submission.