Skip to content

feat: exclude selected fields from json output.#1855

Open
quant12345 wants to merge 1 commit into
Data-Centric-AI-Community:developfrom
quant12345:issue_1680
Open

feat: exclude selected fields from json output.#1855
quant12345 wants to merge 1 commit into
Data-Centric-AI-Community:developfrom
quant12345:issue_1680

Conversation

@quant12345

@quant12345 quant12345 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves #1680.
Added variable: excluded_fields, to exclude fields in json output.

Changes

profile_report.py : By default, excluded_fields=None (all fields).
When passing a list of fields, a check for their presence is performed when generating the JSON.

test_issue1680.py: A data frame is created, the presence of excluded fields is checked, and type error exceptions are intercepted.

Usage

import numpy as np
import pandas as pd
from data_profiling import ProfileReport

np.random.seed(42)
df = pd.DataFrame(np.random.rand(7, 3), columns=["a", "b", "c"])

excluded_fields = [
        "value_counts_without_nan",
        "value_counts_index_sorted",
        "n_var",
        "mean",
        "sum",
        "mad",
    ]

report = ProfileReport(data, excluded_fields=excluded_fields)
report_json = report.to_json()
data_json = json.loads(report_json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The ability to remove any element from the output

1 participant