-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
pynamodb: fix rate_limited_scan defaults #2167
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fad40f8
pynamodb: fix rate_limited_scan defaults
ikonst 95c28da
break up line and add filter_condition
ikonst ce9f9e3
oops, add consistent_read and allow_rate_limited_scan_without_consume…
ikonst 4b8bc6e
add index_name
ikonst 3cc4f54
Update models.pyi
ikonst 978c8d1
fix whitespace
JelleZijlstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,27 @@ class Model(metaclass=MetaModel): | |
@classmethod | ||
def query(cls: Type[_T], hash_key: KeyType, consistent_read: bool = ..., index_name: Optional[Text] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., limit: Optional[int] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Iterable[Text]] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... | ||
@classmethod | ||
def rate_limited_scan(cls: Type[_T], attributes_to_get: Optional[Sequence[Text]], segment: Optional[int] = ..., total_segments: Optional[int] = ..., limit: Optional[int] = ..., conditional_operator: Optional[Text] = ..., last_evaluated_key: Optional[Any] = ..., page_size: Optional[int] = ..., timeout_seconds: Optional[int] = ..., read_capacity_to_consume_per_second: int = ..., max_sleep_between_retry: int = ..., max_consecutive_exceptions: int = ..., **filters: Any): ... | ||
def rate_limited_scan( | ||
cls: Type[_T], | ||
# TODO: annotate Condition class | ||
filter_condition: Optional[Any]=..., | ||
attributes_to_get: Optional[Sequence[Text]] = ..., | ||
segment: Optional[int] = ..., | ||
total_segments: Optional[int] = ..., | ||
limit: Optional[int] = ..., | ||
conditional_operator: Optional[Text] = ..., | ||
last_evaluated_key: Optional[Any] = ..., | ||
page_size: Optional[int] = ..., | ||
timeout_seconds: Optional[int] = ..., | ||
read_capacity_to_consume_per_second: int = ..., | ||
allow_rate_limited_scan_without_consumed_capacity: Optional[bool]=None, | ||
max_sleep_between_retry: int = ..., | ||
max_consecutive_exceptions: int = ..., | ||
consistent_read: Optional[bool] = ..., | ||
index_name: Optional[str] = ..., | ||
**filters: Any | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, sorry for overlooking this. |
||
) -> Iterator[_T]: | ||
... | ||
@classmethod | ||
def scan(cls: Type[_T], segment: Optional[int] = ..., total_segments: Optional[int] = ..., limit: Optional[int] = ..., conditional_operator: Optional[Text] = ..., last_evaluated_key: Optional[Any] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... | ||
@classmethod | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Defaults should always be
...
(you'll get a lint error for this) and=
should be surrounded by spaces if there's a type annotation.