Skip to content

Use schemas.Algorithm for linking#321

Merged
ericbuckley merged 4 commits into
mainfrom
qa/294-swap-algo-schema-for-model
Apr 22, 2025
Merged

Use schemas.Algorithm for linking#321
ericbuckley merged 4 commits into
mainfrom
qa/294-swap-algo-schema-for-model

Conversation

@ericbuckley

@ericbuckley ericbuckley commented Apr 21, 2025

Copy link
Copy Markdown
Collaborator

Description

Send a value of schemas.Algorithm and not models.Algorithm when linking records.

Related Issues

closes #294

Additional Notes

When we save the Algorithm configuration to the database, we store many values as strings (eg blocking keys, features, functions, etc). However, when using the configuration during linkage, we prefer using the enum, functions and objects those strings represent. Previously, this meant we have to cast the string values to its native type in the link and compare methods.

By converting the model data back to a schema.Algorithm object, we can do that casting one time before the linkage process kicks off. This helps simplify our linkage logic a bit as it no longer needs to worry about how to cast strings back to their native data types.

<--------------------- REMOVE THE LINES BELOW BEFORE MERGING --------------------->

Checklist

Please review and complete the following checklist before submitting your pull request:

  • I have ensured that the pull request is of a manageable size, allowing it to be reviewed within a single session.
  • I have reviewed my changes to ensure they are clear, concise, and well-documented.
  • I have updated the documentation, if applicable.
  • I have added or updated test cases to cover my changes, if applicable.
  • I have minimized the number of reviewers to include only those essential for the review.

Checklist for Reviewers

Please review and complete the following checklist during the review process:

  • The code follows best practices and conventions.
  • The changes implement the desired functionality or fix the reported issue.
  • The tests cover the new changes and pass successfully.
  • Any potential edge cases or error scenarios have been considered.

@ericbuckley ericbuckley self-assigned this Apr 21, 2025
@codecov

codecov Bot commented Apr 21, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.15%. Comparing base (8ae8569) to head (9f67430).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   98.08%   98.15%   +0.06%     
==========================================
  Files          32       32              
  Lines        1832     1838       +6     
==========================================
+ Hits         1797     1804       +7     
+ Misses         35       34       -1     

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

@ericbuckley ericbuckley marked this pull request as ready for review April 21, 2025 20:52

@bamader bamader left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems like good cleanup work to me!

@ericbuckley ericbuckley merged commit f54a090 into main Apr 22, 2025
@ericbuckley ericbuckley deleted the qa/294-swap-algo-schema-for-model branch April 22, 2025 22:05
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.

swap models.Algorithm for schemas.Algorithm in linkage

2 participants