Ran
|
Files
22
|
Run time
3s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
<a href="https://github.com/pynamodb/PynamoDB/commit/<a class=hub.com/pynamodb/PynamoDB/commit/63b01ecf8987ed98e92d78c6abb8c94520ad6236">63b01ecf8<a href="https://github.com/pynamodb/PynamoDB/commit/63b01ecf8987ed98e92d78c6abb8c94520ad6236">">Make (GS,LS)Index an indexable type in runtime (#769) Following </a><a class="double-link" href="https://github.com/pynamodb/PynamoDB/commit/<a class="double-link" href="https://github.com/pynamodb/PynamoDB/commit/5426ed9081e91316b214d6c10b447cfa1da8b0af">5426ed908</a>">5426ed908</a><a href="https://github.com/pynamodb/PynamoDB/commit/63b01ecf8987ed98e92d78c6abb8c94520ad6236">, users found themselves having to write some rather unergonomic code to reconcile Python's and a type-checker's perspectives: if TYPE_CHECKING: _MyModelGSI = GlobalSecondaryIndex["MyModel"] else: _MyModelGSI = GlobalSecondaryIndex class MyModelUserIdGSI(_MyModelGSI): """A GSI for looking up by user ID.""" ... class MyModelEmailGSI(_MyModelGSI): """A GSI for looking up by email.""" ... This addresses it by allowing users to rewrite this as: class MyModelUserIdGSI(GlobalSecondaryIndex["MyModel"]): """A GSI for looking up by user ID.""" ... class MyModelEmailGSI(GlobalSecondaryIndex["MyModel"]): """A GSI for looking up by email.""" ... Since we maintain Python 2 compatibility, we cannot assume the typing module is available so we're making a mock Generic class instead.
2566 of 2704 relevant lines covered (94.9%)
0.95 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|