Skip to content
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

Check the total number of rows throughout the catalog import pipeline #345

Merged
merged 5 commits into from
Jul 23, 2024

Conversation

delucchi-cmu
Copy link
Contributor

Change Description

Closes #344

Solution Description

Adds a new argument, expected_total_rows, that users can specify if the total number of rows to be imported is known ahead of time. After the mapping stage, we check this against the total number of rows encountered.

Using the result from the mapping stage, we also check the total for the scheduled reducing stage as well.

Code Quality

  • I have read the Contribution Guide and LINCC Frameworks Code of Conduct
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.72%. Comparing base (6c4451f) to head (079f804).
Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
src/hipscat_import/catalog/run_import.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #345      +/-   ##
==========================================
- Coverage   99.79%   99.72%   -0.07%     
==========================================
  Files          26       26              
  Lines        1442     1452      +10     
==========================================
+ Hits         1439     1448       +9     
- Misses          3        4       +1     

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

@delucchi-cmu delucchi-cmu requested a review from hombit July 17, 2024 16:07
Copy link
Contributor

@hombit hombit 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! I have a minor question

src/hipscat_import/catalog/resume_plan.py Show resolved Hide resolved
Copy link
Collaborator

@troyraen troyraen left a comment

Choose a reason for hiding this comment

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

LGTM. I think it will also be important to check this value against the number of rows in the parquet files directly at some point. In cases where the import process goes a little funky the parquet files can diverge from what was written in log files, and those are cases where this test can be especially valuable.

@delucchi-cmu
Copy link
Contributor Author

LGTM. I think it will also be important to check this value against the number of rows in the parquet files directly at some point. In cases where the import process goes a little funky the parquet files can diverge from what was written in log files, and those are cases where this test can be especially valuable.

The method that writes out the parquet metadata will look at all of the footers for the parquet data files. astronomy-commons/hats#306 will have that method return the total count. This would also be helpful for a few other import pipelines, where we read the footers AGAIN to calculate the total number of rows written. Once that PR is in, I'll update the code here to add the check.

@delucchi-cmu delucchi-cmu merged commit 314a79a into main Jul 23, 2024
8 of 10 checks passed
@delucchi-cmu delucchi-cmu deleted the issue/344/expect_total branch July 23, 2024 13:31
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.

Check the total number of rows throughout the catalog import pipeline
3 participants