MCPcopy Index your code
hub / github.com/plotly/plotly.py / validate_table

Function validate_table

plotly/figure_factory/_table.py:7–22  ·  view source on GitHub ↗

Table-specific validations Check that font_colors is supplied correctly (1, 3, or len(text) colors). :raises: (PlotlyError) If font_colors is supplied incorretly. See FigureFactory.create_table() for params

(table_text, font_colors)

Source from the content-addressed store, hash-verified

5
6
7def validate_table(table_text, font_colors):
8 """
9 Table-specific validations
10
11 Check that font_colors is supplied correctly (1, 3, or len(text)
12 colors).
13
14 :raises: (PlotlyError) If font_colors is supplied incorretly.
15
16 See FigureFactory.create_table() for params
17 """
18 font_colors_len_options = [1, 3, len(table_text)]
19 if len(font_colors) not in font_colors_len_options:
20 raise exceptions.PlotlyError(
21 "Oops, font_colors should be a list of length 1, 3 or len(text)"
22 )
23
24
25def create_table(

Callers 1

create_tableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected