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

Update S3 String Classes + Add new features to ValidatedStr parent class #24

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

Conversation

rpmcginty
Copy link
Collaborator

@rpmcginty rpmcginty commented Jan 6, 2025

  • wip
  • updating ValidatedStr to support sanitization, use PostInit construct
  • remove unused imports
  • revamp S3 path/bucket/key validated string classes

What's in this change?

Addressing -> https://alleninstitute.atlassian.net/browse/DT-7113

Primary incentive is refining the S3Path string class to support spaces (among other special characters - see here).

  • Updating S3Path to use ValidatedStr
    • fixing some previous missed validation
    • utilizing regex to do all validation
    • constraining levels of validation from doing all or no validation (full_validation) to only providing the option to allow placeholders (allow_placeholders).
      • S3BucketName and S3Key also support this individually as string classes too.
  • Updating ValidatedStr with new features
    • adding ability to specify __post_init__
    • adding a _sanitize class method which allows the support for basic sanitization.

Tests

  • adding comprehensive testing.

@rpmcginty rpmcginty force-pushed the feature/update-s3-string-class branch from fa834b0 to 15460cc Compare January 6, 2025 20:33
@rpmcginty rpmcginty requested review from njmei and sheriferson January 6, 2025 20:37
@rpmcginty rpmcginty changed the title Update S3 String Classes + Add new features to ValidatedStr parent class" Update S3 String Classes + Add new features to ValidatedStr parent class Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

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

Project coverage is 96.65%. Comparing base (abc195e) to head (79fc466).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/aibs_informatics_core/collections.py 98.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
+ Coverage   96.55%   96.65%   +0.10%     
==========================================
  Files          54       54              
  Lines        3544     3561      +17     
  Branches      401      403       +2     
==========================================
+ Hits         3422     3442      +20     
+ Misses         69       68       -1     
+ Partials       53       51       -2     
Files with missing lines Coverage Δ
src/aibs_informatics_core/models/aws/s3.py 97.30% <100.00%> (+0.11%) ⬆️
...rmatics_core/models/demand_execution/parameters.py 96.73% <100.00%> (ø)
src/aibs_informatics_core/models/version.py 92.85% <ø> (ø)
src/aibs_informatics_core/utils/multiprocessing.py 100.00% <ø> (ø)
src/aibs_informatics_core/collections.py 98.19% <98.33%> (+0.53%) ⬆️

... and 1 file with indirect coverage changes

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.

1 participant