-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement user functions for dynamodb #62
Conversation
Only stubs remain....
Also update pipenv lockfile
Instead of just one.
Codecov Report
@@ Coverage Diff @@
## master #62 +/- ##
========================================
+ Coverage 98.65% 100% +1.34%
========================================
Files 5 7 +2
Lines 149 199 +50
========================================
+ Hits 147 199 +52
+ Misses 2 0 -2
Continue to review full report at Codecov.
|
docs/Database.md
Outdated
`image_url` | `String`; The user's avatar image URL | ||
`permission_level` | `String`; The user's permission level | ||
|
||
The user's permission levle is one of `['member', 'admin', 'team_lead']`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling ("levle").
README.md
Outdated
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb | ||
``` | ||
|
||
To have it executing in the background, simply add an ampersand (&) at the end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be useful to add slightly more detail here for users that don't know much about running things in the background (i.e. what does it mean to kill a process?). That might be too complex for this though.
db/dynamodb.py
Outdated
|
||
|
||
class DynamoDB: | ||
"""DynamoDB.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docstring could be a bit more informative.
:return: boolean value, true if table exists, false otherwise | ||
""" | ||
existing_tables = self.ddb.tables.all() | ||
return any(map(lambda t: t.name == table_name, existing_tables)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
user.set_biography(response['bio']) | ||
user.set_image_url(response['image_url']) | ||
user.set_permissions_level(Permissions[response['permission_level']]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a good place to do some error handling/postcondition checking. We don't want invalid users floating around if somehow we end up missing some fields in DynamoDb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing fields in dynamodb doesn't occur because the fields cannot be blank on storage. Thus I will make a static function that validates the models (make sure that all fields are non-empty).
Pull Request
Description
Lot's of functions, predicates, and tests for getting things from dynamodb users table.
Ticket(s)
Closes #33, closes #56