-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix bad href substitution on pagination usage #14
Conversation
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.
Change looks good to me, but can you add:
- unit test
- changelog entry
I'll work on this ASAP! |
3222ead
to
57f6502
Compare
@gadomski done, let me know if the test is enough for you |
tests/resources/test_item.py
Outdated
resp_json = resp.json() | ||
links = resp_json["links"] | ||
assert links[0]["rel"] == "next" | ||
assert links[0]["href"].startswith("http://testserver/search?") |
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.
We shouldn't rely on link ordering, we should find the link by rel. E.g.
resp_json = resp.json() | |
links = resp_json["links"] | |
assert links[0]["rel"] == "next" | |
assert links[0]["href"].startswith("http://testserver/search?") | |
resp_json = resp.json() | |
link = next(l for l in resp_json["links"] if l["rel"] == "next) | |
assert link["href"].startswith("http://testserver/search?") |
tests/resources/test_item.py
Outdated
assert links[0]["rel"] == "next" | ||
assert links[1]["rel"] == "previous" |
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.
Same as above, we should not rely on link ordering, but instead fetch by rel.
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.
Looks like CI is failing due to some incorrect validation on the part of stac-pydantic -- bboxs are allowed to have a minx greater than the maxx if they cross the antimeridian. I started on a fix for the problem in stac-pydantic, but that repo is pretty out-of-date and has a lot of failing tests, so it wasn't going to be a quick fix.
I'm willing to merge this PR through that failing test (once my review comments are applied), but after that someone should go fix stac-pydantic. I'm not really funded to do so, so its unlikely that I'll be able to. stac-utils/stac-pydantic#122
Co-authored-by: Pete Gadomski <[email protected]>
Co-authored-by: Pete Gadomski <[email protected]>
I can try to take a look there (I fear it will take some time, never digged into it) |
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.
Approving and will merge even w/ CI failures because stac-pydantic needs a lot of work.
This closes #13
Related Issue(s):
Description:
See #13
PR Checklist:
pre-commit
hooks pass locallymake test
)make docs
)