Nested dp.Select not working
See original GitHub issueDescribe the bug In the docs concerning Select, there is a note:
Select expects a list of Blocks, e.g. a Plot or Table, but also including Select or Groups themselves, but if a Python object is passed, e.g. a Dataframe, Datapane will attempt to convert it automatically.
However, I am not able to get nested selects working. Instead, the outer selection method (tab or dropdown doesn’t matter) shows, and the inner one is missing, in its place being an empty doc symbol:
To Reproduce Execute the following repro script:
import datapane as dp
def create_plot_selection() -> dp.Select:
test_dict = {
"outer1": {
"inner11label": "inner11",
"inner12label": "inner12"
},
"outer2": {
"inner21label": "inner21",
"inner22label": "inner22",
"inner23label": "inner23"
}
}
outer_choice_blocks = []
for outer_choice_label, inner_choices in test_dict.items():
inner_choice_blocks = []
for label, test_item in inner_choices.items():
inner_choice_blocks.append(dp.Text(test_item, label=label))
outer_choice_blocks.append(dp.Select(blocks=inner_choice_blocks, label=outer_choice_label, type=dp.SelectType.TABS))
return dp.Select(blocks=outer_choice_blocks, type=dp.SelectType.DROPDOWN)
report = dp.Report(blocks=["Should see more than a document icon after selecting an outer choice:", create_plot_selection()])
report.save(path='report.html')
Expected behavior When opening the generated report, I’d expect to be able to use an inner select
Desktop (please complete the following information):
- OS: Linux Mint 20,
- Browser: Firefox on Linux,
- Version 84.0.1 (64-bit) on Linux, on android
Smartphone (please complete the following information):
- Device: Redmi 7
- OS: Android 10
- Browser: Firefox and Chrome
- Version: firefox 84.1.2 and chrome 87.0.4280
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Error in syntax for nested Select Case - sql - Stack Overflow
Quantity from ( select case when D.P> T.Open then D.P from DOP D inner join T on D.PON = T.PON )a. I am...
Read more >Converting nested JSON structures to Pandas DataFrames
In this article, we are going to see how to convert nested JSON structures to Pandas DataFrames. JSON with multiple levels.
Read more >PartiQL Tutorial
Creating Nested Results with SELECT VALUE Queries; Creating Nested Results with ... Let's write a simple query to verify that our PartiQL REPL...
Read more >Nested Dynamic Panel - Axure RP 9
If you have nested dynamic panels and you close an inner one it takes you ... only seems to work in one way,...
Read more >The Nested Dirichlet Process
Although most of these ap- plications focus on problems with exchangeable samples from one unknown distribution, there is growing interest in extending the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mands Yep the FE deserialiser doesn’t allow
Select
s to be direct ancestors of otherSelect
s. Should be quick to allow this though.@Buroni - have added a unit test on the CLI side and can successfully generate valid reports with nested Selects - I think the issue may be on the FE renderer