Skip to content

feat!: Refactor TTC lambda function and condense saved models.#570

Draft
JNygaard-Skylight wants to merge 24 commits into
mainfrom
josh/ttc-lambda-refactor
Draft

feat!: Refactor TTC lambda function and condense saved models.#570
JNygaard-Skylight wants to merge 24 commits into
mainfrom
josh/ttc-lambda-refactor

Conversation

@JNygaard-Skylight
Copy link
Copy Markdown
Collaborator

@JNygaard-Skylight JNygaard-Skylight commented May 21, 2026

Description

The primary goal of this branch was to remove fields from the models that are the outputs of our lambda functions (the metadata and the data that is passed from TTC to augmentation). This simplifies the code in several places and Pydantic handles the serialization/deserialization and allows us to improve the typing .

Details

  • Format snapshots to improve maintainability.
  • Simplify the reading of the Augmentation input by loading it as a model, instead of just a dictionary. This removes the need for the _parse_nonstandard_codes function and all of its associated tests.
  • Simplify the augmentation metadata:
    • Removed the "schematron_error" from the nonstandard code model
  • Simplify the output of the TTC (the Augmentation input) by removing fields not used by the augmenter:
    -"eicr_metadata" field.
    • "schematron_error"
  • Combined two tests in test_augmentation_lambda_function.py: test_handler_success , and test_handler_writes_outputs_to_s3 as they were testing the same thing, but with different asserts.
  • Created a new model for the TTC metadata, instead of a dictionary TTCMetadata.
  • Rewrote _process_record_pipeline:
    • Simplify the flow of data. Previously dictionaries were being implicitly passed between functions
    • Added type hinting where it was missing.
  • The reranker serializes the score float to 3 decimal places

Related Issues

Closes #527

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

Codecov Report

❌ Patch coverage is 93.51852% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.43%. Comparing base (3a0500d) to head (7038749).

Files with missing lines Patch % Lines
...-lambda/src/augmentation_lambda/lambda_function.py 60.00% 6 Missing ⚠️
...-lambda/src/text_to_code_lambda/lambda_function.py 98.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #570      +/-   ##
==========================================
- Coverage   90.85%   90.43%   -0.43%     
==========================================
  Files          50       50              
  Lines        2691     2666      -25     
==========================================
- Hits         2445     2411      -34     
- Misses        246      255       +9     

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

@JNygaard-Skylight JNygaard-Skylight marked this pull request as ready for review May 21, 2026 16:49
@JNygaard-Skylight JNygaard-Skylight marked this pull request as draft May 22, 2026 16:54
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.

Missing data in TTC metadata

2 participants