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

Add required keys to projections #44

Merged
merged 4 commits into from
Jun 10, 2020
Merged

Conversation

vemel
Copy link
Contributor

@vemel vemel commented Jun 10, 2020

Notes

DynamoTable was raising errors when getting keys for records that contain required fields, becuse it retrieved only pk and sk.

class UserRecord(DynamoDictClass):
   name: str # required field

UserTable[UserRecord]().clear_table() # previously raised an exception

Public API changes

Added

  • DynamoDictClass.get_required_field_names method
  • DynamoDictClass.get_field_names method

Fixed

  • DynamoTable now works with DynamoDictClass with required fields
  • DynamoDictClass child class methods were detected as field names
  • DynamoDictClass fields are initialized only once per class

@github-actions github-actions bot added the minor label Jun 10, 2020
@codecov
Copy link

codecov bot commented Jun 10, 2020

Codecov Report

Merging #44 into master will increase coverage by 1.25%.
The diff coverage is 98.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   95.13%   96.38%   +1.25%     
==========================================
  Files          16       16              
  Lines        1728     1745      +17     
==========================================
+ Hits         1644     1682      +38     
+ Misses         84       63      -21     
Impacted Files Coverage Δ
dynamo_query/dynamo_table.py 93.37% <83.33%> (-0.23%) ⬇️
dynamo_query/dictclasses/dictclass.py 96.81% <100.00%> (-0.79%) ⬇️
dynamo_query/dictclasses/dynamo_dictclass.py 100.00% <100.00%> (ø)
dynamo_query/dictclasses/loose_dictclass.py 87.50% <100.00%> (-6.62%) ⬇️
dynamo_query/data_table.py 100.00% <0.00%> (+1.59%) ⬆️
dynamo_query/dynamo_autoscaler.py 39.28% <0.00%> (+39.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4551e05...28daea3. Read the comment docs.

amirkav
amirkav previously approved these changes Jun 10, 2020
@vemel vemel merged commit 6214b65 into master Jun 10, 2020
@github-actions github-actions bot mentioned this pull request Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants