Skip to content

docs: TypeErrors on docstrings on website #11343

@IndexSeek

Description

@IndexSeek

Please describe the issue

On many of the table expression API docs (https://ibis-project.org/reference/expression-json for example), it's displaying the following error:

TypeError                                 Traceback (most recent call last)
File /nix/store/6jgbma9qdxb864pzzi7909if32j7jbj6-ibis-3.12/lib/python3.12/site-packages/IPython/core/formatters.py:1036, in MimeBundleFormatter.__call__(self, obj, include, exclude)
   1033     method = get_real_method(obj, self.print_method)
   1035     if method is not None:
-> 1036         return method(include=include, exclude=exclude)
   1037     return None
   1038 else:

File ~/work/ibis/ibis/ibis/expr/types/rich.py:36, in RichJupyterMixin._repr_mimebundle_(self, include, exclude, **kwargs)
     33 def _repr_mimebundle_(
     34     self, include: Sequence[str], exclude: Sequence[str], **kwargs
     35 ) -> dict[str, str]:
---> 36     bundle = capture_rich_renderable(self, no_color=False)
     37     return {k: bundle[k] for k in (bundle.keys() & include).difference(exclude)}

File ~/work/ibis/ibis/ibis/expr/types/rich.py:54, in capture_rich_renderable(renderable, no_color)
     50     width = 1_000_000
     51 with _with_rich_configured(
     52     width=width, color_system=color_system, force_terminal=False
     53 ):
---> 54     return _RichMimeBundler(renderable).get_mimebundle()

File ~/work/ibis/ibis/ibis/expr/types/rich.py:117, in _RichMimeBundler.get_mimebundle(self)
    115 def get_mimebundle(self) -> dict[str, str]:
    116     with _with_rich_display_disabled():
--> 117         bundle = super()._repr_mimebundle_(include=None, exclude=None)
    118     bundle["text/plain"] = bundle["text/plain"].rstrip()  # Remove trailing newline
    119     return bundle

File /nix/store/6jgbma9qdxb864pzzi7909if32j7jbj6-ibis-3.12/lib/python3.12/site-packages/rich/jupyter.py:48, in JupyterMixin._repr_mimebundle_(self, include, exclude, **kwargs)
     41 def _repr_mimebundle_(
     42     self: "ConsoleRenderable",
     43     include: Sequence[str],
     44     exclude: Sequence[str],
     45     **kwargs: Any,
     46 ) -> Dict[str, str]:
     47     console = get_console()
---> 48     segments = list(console.render(self, console.options))
     49     html = _render_segments(segments)
     50     text = console._render_buffer(segments)

File /nix/store/6jgbma9qdxb864pzzi7909if32j7jbj6-ibis-3.12/lib/python3.12/site-packages/rich/console.py:1344, in Console.render(self, renderable, options)
   1342     yield render_output
   1343 else:
-> 1344     yield from self.render(render_output, _options)

File /nix/store/6jgbma9qdxb864pzzi7909if32j7jbj6-ibis-3.12/lib/python3.12/site-packages/rich/console.py:1320, in Console.render(self, renderable, options)
   1318 renderable = rich_cast(renderable)
   1319 if hasattr(renderable, "__rich_console__") and not isclass(renderable):
-> 1320     render_iterable = renderable.__rich_console__(self, _options)
   1321 elif isinstance(renderable, str):
   1322     text_renderable = self.render_str(
   1323         renderable, highlight=_options.highlight, markup=_options.markup
   1324     )

File ~/work/ibis/ibis/ibis/expr/types/core.py:75, in Expr.__rich_console__(self, console, options)
     73 try:
     74     if opts.interactive:
---> 75         rich_object = to_rich(self, console_width=console_width)
     76     else:
     77         rich_object = Text(self._noninteractive_repr())

File ~/work/ibis/ibis/ibis/expr/types/rich.py:75, in to_rich(expr, max_rows, max_columns, max_length, max_string, max_depth, console_width)
     71     return to_rich_scalar(
     72         expr, max_length=max_length, max_string=max_string, max_depth=max_depth
     73     )
     74 else:
---> 75     return to_rich_table(
     76         expr,
     77         max_rows=max_rows,
     78         max_columns=max_columns,
     79         max_length=max_length,
     80         max_string=max_string,
     81         max_depth=max_depth,
     82         console_width=console_width,
     83     )

File ~/work/ibis/ibis/ibis/expr/types/_rich.py:432, in to_rich_table(tablish, max_rows, max_columns, max_length, max_string, max_depth, console_width)
    413             break
    415 # If the console width is unbounded, then explicitly make each column
    416 # take up its full width.
    417 # Otherwise, when you render the returned rich.Table in a rich.Console,
   (...)    429 # └┴┴─────┴────┴────────┴──┴┴┴┴┴┴┴┴┴┴┴┴┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴┴─┴┴─┴┴─┘
    430 # unless you set the width of the table explicitly.
    431 table_width = (
--> 432     1 + sum(col_widths.values()) + len(col_info) * 3
    433     if console_width == float("inf")
    434     else None
    435 )
    436 rich_table = rich.table.Table(padding=(0, 1, 0, 1), width=table_width)
    438 # Configure the columns on the rich table.

TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation related issues or PRs

    Type

    No type

    Projects

    Status

    done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions