Skip to content

Make corpus alignment exceptions more generic#420

Open
pmachapman wants to merge 1 commit into
masterfrom
generic_alignment_exceptions
Open

Make corpus alignment exceptions more generic#420
pmachapman wants to merge 1 commit into
masterfrom
generic_alignment_exceptions

Conversation

@pmachapman
Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman commented May 21, 2026

Part of sillsdev/machine.py#283


This change is Reviewable

@pmachapman pmachapman requested review from Enkidu93 and ddaspit May 21, 2026 01:41
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.14%. Comparing base (f6bae46) to head (bdd2182).

Files with missing lines Patch % Lines
src/SIL.Machine/Corpora/CorporaExtensions.cs 0.00% 4 Missing ⚠️
src/SIL.Machine/Corpora/NParallelTextCorpus.cs 0.00% 3 Missing ⚠️
src/SIL.Machine/Corpora/ParallelTextCorpus.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
+ Coverage   73.13%   73.14%   +0.01%     
==========================================
  Files         440      439       -1     
  Lines       36822    36816       -6     
  Branches     5061     5061              
==========================================
  Hits        26930    26930              
+ Misses       8781     8775       -6     
  Partials     1111     1111              

☔ 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.

Copy link
Copy Markdown
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

@Enkidu93 reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ddaspit and pmachapman).


src/SIL.Machine/Corpora/CorporaExtensions.cs line 62 at r1 (raw file):

            where T : IRow =>
            new ArgumentException(
                $"Invalid format in {string.Join(", ", refs)}. Mismatched key formats. There may be an extraneous tab, missing ref, or inconsistent use of user-defined refs.",

I think we can make this even more generic. Something as simple as "Unable to align rows with refs: {refs}" would do. The main thing we want to capture with this exception are the refs that we were unable to align with. The details about tabs and user-defined refs is Serval-specific.

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

@ddaspit reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on pmachapman).


src/SIL.Machine/Corpora/CorporaExtensions.cs line 61 at r1 (raw file):

        )
            where T : IRow =>
            new ArgumentException(

ArgumentException doesn't feel right to me, since the error is not caused by passing an incorrect argument to the called method. InvalidOperationException would probably be more appropriate.

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.

4 participants