Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`get_dataframe_report()` raises TypeError when a step has `columns_subset` (rows_distinct, rows_complete)

Closed Beginner friendly
#442 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #446 by @manan28025 — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

Start in get_dataframe_report() and inspect the pl_schema definition for the column field, then trace how rows_distinct() and rows_complete() with columns_subset= populate validation_info[i].column. Reproduce with the supplied example and check the report’s column values for both subset steps after the change; the report should build without a TypeError and retain the selected column names.

Written by the indexing model from the issue text.

Description

Description

Validate.get_dataframe_report() fails with a Polars TypeError as soon as the plan contains a step whose column is a list, i.e. rows_distinct() or rows_complete() with columns_subset=. The whole report is lost, not just that step.

Reproducer

import polars as pl
import pointblank as pb

df = pl.DataFrame({"a": [1, 2, 2], "b": ["x", "y", None]})

pb.Validate(df).rows_distinct().interrogate().get_dataframe_report()            # OK
pb.Validate(df).rows_distinct(columns_subset=["a"]).interrogate().get_dataframe_report()

Error:

TypeError: unexpected value while building Series of type String; found value of type List(String): ["a"]

Hint: Try setting `strict=False` to allow passing data with mixed types.

Same result with rows_distinct(columns_subset=["a", "b"]) and rows_complete(columns_subset=["a", "b"]). Steps where columns= is a list (e.g. col_vals_gt(columns=["a"])) are fine, since they are expanded into one step per column.

Reproduced on 0.24.0 (where the method was added in #341), 0.27.0 and 1.0.1.

Cause

In get_dataframe_report(), the Polars schema declares the column field as a string (line 21497 on main at 4510729):

pl_schema = pl.Schema(
    {
        ...
        "column": pl.String,
        ...
    }
)

For rows_distinct() / rows_complete() with columns_subset=, validation_info[i].column is a list of names, so pl.DataFrame(data=final_report, schema=pl_schema) fails.

Possible fix

Normalize list values before building the frame, e.g. join them into a string ("a, b"), which keeps columns a String column for every step. Alternatively declare it as pl.List(pl.String) and wrap single names in a list, though that changes the column type for all users.

Environment

  • pointblank 1.0.1
  • polars 1.38.1
  • Python 3.12.7
  • Linux

Found while using pointblank in fauxdata.

Dominant language
Python
Stars
493
Forks
34
Avg merge
14h 29m
Merged PRs (30d)
15

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/pointblank

All issues in posit-dev/pointblank

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.