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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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: 7a05652
Status: ✅  Deploy successful!
Preview URL: https://1024bc17.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 87.92%. Comparing base (0db2282) to head (7a05652).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1071      +/-   ##
==========================================
- Coverage   87.94%   87.92%   -0.03%     
==========================================
  Files         148      148              
  Lines       12752    12755       +3     
  Branches     1783     1784       +1     
==========================================
  Hits        11215    11215              
- Misses       1098     1100       +2     
- Partials      439      440       +1     
Flag Coverage Δ
datachain 87.85% <100.00%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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)

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
2 participants