Skip to content

Add json parquet loader - #127

Merged
yakew7 merged 2 commits into
yakew7:mainfrom
ahmdkaml:add-json-parquet-loader
Aug 4, 2026
Merged

Add json parquet loader#127
yakew7 merged 2 commits into
yakew7:mainfrom
ahmdkaml:add-json-parquet-loader

Conversation

@ahmdkaml

@ahmdkaml ahmdkaml commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR extends read_table() to support additional table formats:

  • Add support for .json

    • List-of-records orientation
    • split orientation
  • Add support for .parquet using pandas.read_parquet()

  • Mirror the existing optional dependency handling for Excel by providing a clear error message when pyarrow is not installed.

  • Update the CLI usage examples to include JSON and Parquet.

  • Add tests covering:

    • JSON (records)
    • JSON (split)
    • Parquet
    • CSV ↔ JSON profile parity
    • CSV ↔ Parquet profile parity

Closes #113.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@ahmdkaml is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@ahmdkaml
ahmdkaml marked this pull request as ready for review August 4, 2026 16:57
Copilot AI lite review requested due to automatic review settings August 4, 2026 16:57
@ahmdkaml

ahmdkaml commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi! I really enjoyed working on this project and I feel like I'm starting to get familiar with the codebase.

I've just opened a PR for #113. If everything looks good there, I'd like to work on #111 next.

I also noticed the explainer issues. They look interesting, although I'm not sure if they're a current priority. If they are, I'd be happy to take one of those as well.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the dataset loader (read_table()) to accept additional input formats requested in #113, and expands the loader test suite accordingly.

Changes:

  • Add .json support to read_table() (records + split orientation fallback).
  • Add .parquet support to read_table() (via pandas.read_parquet() with optional dependency handling).
  • Add tests for JSON/Parquet loading and profile parity across formats, plus CLI usage examples.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
faircode/loaders.py Adds JSON and Parquet branches to read_table(), including a missing-dependency error path for Parquet.
tests/test_loaders.py Adds loader tests for JSON (records/split), Parquet, and CSV parity comparisons.
faircode/cli.py Updates CLI docstring usage examples to include JSON and Parquet inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread faircode/loaders.py
Comment on lines +38 to +42
if suffix == ".json":
try:
return pd.read_json(path)
except ValueError:
return pd.read_json(path, orient="split")
Comment thread faircode/loaders.py
Comment on lines +48 to +51
raise RuntimeError(
"reading .parquet files requires the 'pyarrow' package "
"(install with: pip install faircode[parquet])"
) from exc
Comment thread faircode/loaders.py
Comment on lines 35 to +38
if suffix == ".csv":
return pd.read_csv(path)

if suffix == ".json":
@yakew7

yakew7 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Hey! Thanks for the interest in my project! This PR is fine i will be merging it and you can solve issue #111 next if u want!

The explainers are js for others to understand what ai bias is and is a way for researchers to contribute!

@yakew7
yakew7 merged commit 312b693 into yakew7:main Aug 4, 2026
11 of 12 checks passed
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.

Profiler: accept .json and .parquet input files

3 participants