Repository navigation
Conversation
Users who only ever call plot.selected_rows(df) had to know to write
listen_to=["selected"] -- the accessor they never call by that name.
AccessorSpec now takes an `aliases` field; plotly's SELECTED spec
declares aliases=("selected_rows",), and listen_to is normalized to
canonical accessor names once at the render_widget_base/Accessors
boundary, so every downstream check (opt-in gating, muted-trait
suppression, unknown-name validation) sees canonical names without
needing its own alias handling. The opt-in error for selected_rows()
now suggests listen_to=["selected_rows"]; selected() keeps suggesting
["selected"] (the `call` kwarg to _read_accessor/Accessors.read now
drives both the displayed method and the listen_to suggestion from
one value).
Docs, examples, gallery apps, and the bundled skill references are
updated everywhere the code only reads selected_rows() (not
selected() itself); call sites that read selected() directly keep
["selected"]. website/guide/ai-exploration/ is intentionally left
untouched (being rewritten on another branch).
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.
Why
The rule for opting into a plotly accessor is "pass the name of the method you call to
listen_to." That broke forselected_rows(df): it reads theselectedaccessor internally, so a caller who only ever writesplot.selected_rows(df)still had to know to writelisten_to=["selected"]-- a method they never call.listen_to=["selected_rows"]is now accepted too and enables the same accessor, so the rule holds for every public method.Both spellings stay valid (and passing both is fine);
selected()/selected_rows()remain separate methods -- this only changes what you pass tolisten_to. The opt-in error you get from callingselected_rows()without opting in now also suggestslisten_to=["selected_rows"]instead of["selected"].Stacked on #518.
Implementation notes
AccessorSpecgains analiasesfield; plotly'sSELECTEDspec setsaliases=("selected_rows",).listen_tois normalized to canonical accessor names once, at therender_widget_base/Accessorsboundary, so opt-in gating, muted-trait suppression, and unknown-name validation all see canonical names without extra alias-handling at each site. Unknown-name errors now list aliases among the valid names._read_accessor/Accessors.read'scallkwarg (added in Name the calling method in opt-in accessor errors #518) now drives both the displayed method and thelisten_tosuggestion from one value, soselected_rows()'s error suggests"selected_rows"while directselected()calls keep suggesting"selected".selected_rows()(notselected()itself); sites that callselected()directly keep["selected"].website/guide/ai-exploration/is intentionally left untouched -- it's being rewritten on another branch.