[nb] zotero_tutorial.py: exception: could not append value: "seed:true,source:internal" of type: str to the builder; make sure that all rows have the same s #561

Closed
opened 2026-07-10 18:02:54 +00:00 by kert · 1 comment
Owner

Auto-filed by the notebook error filer (nb-sig:1d96cd072580 — do not edit this marker; dedup and auto-close key on it).

  • Notebook: zotero_tutorial.py
  • Error: exception: could not append value: "seed:true,source:internal" of type: str to the builder; make sure that all rows have the same schema or consider increasing infer_schema_length

it might also be that a value overflows the data-type's capacity

  • Source: nb-integration/all
Traceback (most recent call last):
  File "/tmp/marimo_22759/__marimo__cell_ecfG_.py", line 1, in <module>
    library_df = pl.read_database(
        """
    ...<28 lines>...
        connection=db,
    )
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/functions.py", line 287, in read_database
    ).to_polars(
      ~~~~~~~~~^
        batch_size=batch_size,
        ^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        infer_schema_length=infer_schema_length,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/_executor.py", line 588, in to_polars
    frame = frame_init(
        batch_size=batch_size,
    ...<2 lines>...
        infer_schema_length=infer_schema_length,
    )
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/_executor.py", line 321, in _from_rows
    return frames if iter_batches else next(frames)  # type: ignore[arg-type]
                                       ~~~~^^^^^^^^
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/_executor.py", line 304, in <genexpr>
    DataFrame(
    ~~~~~~~~~^
        data=rows,
        ^^^^^^^^^^
    ...<3 lines>...
        orient="row",
        ^^^^^^^^^^^^^
    )
    ^
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/dataframe/frame.py", line 409, in __init__
    self._df = sequence_to_pydf(
               ~~~~~~~~~~~~~~~~^
        data,
        ^^^^^
    ...<5 lines>...
        nan_to_null=nan_to_null,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/_utils/construction/dataframe.py", line 466, in sequence_to_pydf
    return _sequence_to_pydf_dispatcher(
        get_first_non_none(data),
    ...<6 lines>...
        nan_to_null=nan_to_null,
    )
  File "/home/kert/.local/share/uv/python/cpython-3.13.14-linux-x86_64-gnu/lib/python3.13/functools.py", line 934, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/_utils/construction/dataframe.py", line 689, in _sequence_of_tuple_to_pydf
    return _sequence_of_sequence_to_pydf(
        first_element,
    ...<6 lines>...
        nan_to_null=nan_to_null,
    )
  File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/_utils/construction/dataframe.py", line 603, in _sequence_of_sequence_to_pydf
    pydf = PyDataFrame.from_rows(
        data,
        schema=local_schema_override or None,
        infer_schema_length=infer_schema_length,
    )
polars.exceptions.ComputeError: could not append value: "seed:true,source:internal" of type: str to the builder; make sure that all rows have the same schema or consider increasing `infer_schema_length`

it might also be that a value overflows the data-type's capacity

This issue is closed automatically when the error stops occurring.

Auto-filed by the notebook error filer (`nb-sig:1d96cd072580` — do not edit this marker; dedup and auto-close key on it). - **Notebook:** `zotero_tutorial.py` - **Error:** `exception`: could not append value: "seed:true,source:internal" of type: str to the builder; make sure that all rows have the same schema or consider increasing `infer_schema_length` it might also be that a value overflows the data-type's capacity - **Source:** nb-integration/all ``` Traceback (most recent call last): File "/tmp/marimo_22759/__marimo__cell_ecfG_.py", line 1, in <module> library_df = pl.read_database( """ ...<28 lines>... connection=db, ) File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/functions.py", line 287, in read_database ).to_polars( ~~~~~~~~~^ batch_size=batch_size, ^^^^^^^^^^^^^^^^^^^^^^ ...<2 lines>... infer_schema_length=infer_schema_length, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/_executor.py", line 588, in to_polars frame = frame_init( batch_size=batch_size, ...<2 lines>... infer_schema_length=infer_schema_length, ) File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/_executor.py", line 321, in _from_rows return frames if iter_batches else next(frames) # type: ignore[arg-type] ~~~~^^^^^^^^ File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/io/database/_executor.py", line 304, in <genexpr> DataFrame( ~~~~~~~~~^ data=rows, ^^^^^^^^^^ ...<3 lines>... orient="row", ^^^^^^^^^^^^^ ) ^ File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/dataframe/frame.py", line 409, in __init__ self._df = sequence_to_pydf( ~~~~~~~~~~~~~~~~^ data, ^^^^^ ...<5 lines>... nan_to_null=nan_to_null, ^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/_utils/construction/dataframe.py", line 466, in sequence_to_pydf return _sequence_to_pydf_dispatcher( get_first_non_none(data), ...<6 lines>... nan_to_null=nan_to_null, ) File "/home/kert/.local/share/uv/python/cpython-3.13.14-linux-x86_64-gnu/lib/python3.13/functools.py", line 934, in wrapper return dispatch(args[0].__class__)(*args, **kw) ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/_utils/construction/dataframe.py", line 689, in _sequence_of_tuple_to_pydf return _sequence_of_sequence_to_pydf( first_element, ...<6 lines>... nan_to_null=nan_to_null, ) File "/home/kert/workspace/.venv/lib/python3.13/site-packages/polars/_utils/construction/dataframe.py", line 603, in _sequence_of_sequence_to_pydf pydf = PyDataFrame.from_rows( data, schema=local_schema_override or None, infer_schema_length=infer_schema_length, ) polars.exceptions.ComputeError: could not append value: "seed:true,source:internal" of type: str to the builder; make sure that all rows have the same schema or consider increasing `infer_schema_length` it might also be that a value overflows the data-type's capacity ``` This issue is closed automatically when the error stops occurring.
kert added the notebooks label 2026-07-10 18:02:54 +00:00
Author
Owner

Fixed in e8f6385bc5. The CASE/GROUP_CONCAT queries can return columns that are entirely NULL inside polars' default schema-inference window, with strings appearing later — the exact failure the error message hints at. Pinned infer_schema_length=None on all pl.read_database calls in the notebook. (This error only became reachable after the immutable=1 fix got reads past the 'database is locked' error, #557.) Verified: headless export in the prod container now has zero cell errors.

Fixed in https://git.fhirworx.io/homelab/stack/commit/e8f6385bc547f8d808ee9acbe0597daa26a663e8. The CASE/GROUP_CONCAT queries can return columns that are entirely NULL inside polars' default schema-inference window, with strings appearing later — the exact failure the error message hints at. Pinned `infer_schema_length=None` on all `pl.read_database` calls in the notebook. (This error only became reachable after the `immutable=1` fix got reads past the 'database is locked' error, #557.) Verified: headless export in the prod container now has zero cell errors.
kert closed this issue 2026-07-10 18:37:35 +00:00
Sign in to join this conversation.