Skip to content

Fix for reading exported parquet #1071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 9, 2025

Conversation

ilongin
Copy link
Contributor

@ilongin ilongin commented Apr 30, 2025

Fixing the issue when we read parquet file that is being created with datachain itself and already has source fields inside it. What was happening is that we were adding duplicated source fields on read and this PR avoids that even if source=True flag is set.

@ilongin ilongin linked an issue Apr 30, 2025 that may be closed by this pull request
Copy link

cloudflare-workers-and-pages bot commented Apr 30, 2025

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: e560b08
Status: ✅  Deploy successful!
Preview URL: https://e36e01c3.datachain-documentation.pages.dev
Branch Preview URL: https://ilongin-1066-fix-reading-exp.datachain-documentation.pages.dev

View logs

@shcheklein
Copy link
Member

@ilongin tests are broken?

@ilongin should we actually rewrite source if source is True? 🤔 since the existing source is kinda wrong by now ...

Copy link

codecov bot commented May 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.69%. Comparing base (ff97825) to head (e560b08).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1071   +/-   ##
=======================================
  Coverage   88.68%   88.69%           
=======================================
  Files         152      152           
  Lines       13606    13609    +3     
  Branches     1893     1894    +1     
=======================================
+ Hits        12067    12070    +3     
  Misses       1093     1093           
  Partials      446      446           
Flag Coverage Δ
datachain 88.62% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/datachain/lib/arrow.py 98.80% <100.00%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ilongin
Copy link
Contributor Author

ilongin commented May 19, 2025

@ilongin should we actually rewrite source if source is True? 🤔 since the existing source is kinda wrong by now ...

Make sense, I've overwritten it now with new source.

if self.output_schema and hasattr(vals[0], "source"):
# if we are reading parquet file written by datachain it might have
# source inside of it already, so we should not duplicate it, instead
# we are re-creating it
Copy link
Member

Choose a reason for hiding this comment

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

cleanup the comment a bit ... (no extra line is needed)

Copy link
Member

Choose a reason for hiding this comment

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

let's also add to docs (source=True) - that if it enabled and the file already has it - it will be rewritten (e.g. when file was generated by datachain before)

Copy link
Contributor

@dreadatour dreadatour left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@shcheklein
Copy link
Member

@ilongin what is the status here?

@ilongin ilongin merged commit 6640a1b into main Jul 9, 2025
35 checks passed
@ilongin ilongin deleted the ilongin/1066-fix-reading-exported-parquet branch July 9, 2025 13:00
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.

Parquet: reading exported parquet file
3 participants