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.
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
Feat/tr/pagination #123
Feat/tr/pagination #123
Changes from 9 commits
152a227
0dcf05b
7734317
16f4dc2
e0fa4e7
90d0ebd
53afb66
723e645
7b3453e
5db53c1
b690cf1
068e4b2
55e1c60
8886988
2fca5c7
d3c5aa8
ac661d9
690e44f
e562d56
1cdc145
af2e2ad
2759ec2
0d5d837
fb9710e
adf1f5f
cc8fd62
a5999bd
9cfd146
35c8f53
c148b7d
3a2d9c1
7949857
a19bd34
4d17e1c
3ef8146
33a9d38
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Why did you change the name of
orders
tocollections
?backend.get_orders
should be returning a list ofOrder
objects to be composed into a singleOrderCollection
.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.
Oh, I was wrong here. The typing on
backend.get_orders
say it is returning anOrderCollection
, notlist[Order]
. I am uncertain why this is the case and it feels wrong to me. I'd expect theOrderCollection
to be assembled here in this function from alist[Order]
. I'm am curious to go back and see if/when that changed, and, if it did, if I can figure out why.Unless the backend has a really good reason to manage collection-type objects, I don't think it should. And I don't think there are any good reasons for it to do so.
In any case,
collections
is not an appropriate name for this variable.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.
I believe. it was initially done here df6d1f0#diff-6d77ccddcf13b627327fd192d593943db5acb4be7bc636427a9ce7726b184a4b when it seems the root and product backends were spun off separately, and it was initially set up to return
OrderCollection
. In that same PR it seems thatOrderCollection
was also created, not sure why it was set as the return value. Interestingly the docstring inroot_backend
there specifically sayslist of existing orders
which suggests a return type oflist[Order]
. I agree with your logic and this change was easy to apply, so root backend returnslist[Orders]
and theOrderCollection
is constructed inroot_router.py
Renamed variable too
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.
I'm not sure this comment provides any value. If you feel this code block is not obviously pertaining to pagination then I'd look at ways to make the code more self-documenting instead of adding comments. For example, if you don't see this immediately as handling pagination then what if you changed the name of
token
topagination_token
?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.
great point, I like the renaming idea to make it more strongly self-documenting. Removed comment as well. Might've been a legacy from my initial work.