Skip to content

Unhelpful error message for many facets #1839

Closed
@nicolaskruchten

Description

@nicolaskruchten

Broken off from #1838 (comment)

It was not introduced by this PR, but the behaviour when there is a very large number of cols/rows is weird. For example

px.scatter(gapminder, x="pop", y="lifeExp", facet_row="country")

or

px.scatter(gapminder, x="pop", y="lifeExp", facet_col="country", facet_col_wrap=8)

give errors like

~/code/plotly.py/packages/python/plotly/_plotly_utils/basevalidators.py in raise_invalid_val(self, v, inds)
    281                 typ=type_str(v),
    282                 v=repr(v),
--> 283                 valid_clr_desc=self.description(),
    284             )
    285         )

ValueError: 
    Invalid value of type 'builtins.float' received for the 'domain[1]' property of layout.yaxis
        Received value: -0.010555555555555565

    The 'domain[1]' property is a number and may be specified as:
      - An int or float in the interval [0, 1]

which is not very helpful as an error message. Should we either introduce a limit in the number of cols/rows, or try to catch this and output a better message?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions