-
-
Notifications
You must be signed in to change notification settings - Fork 155
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(recap): Enables appellate attachment page purchases #4919
feat(recap): Enables appellate attachment page purchases #4919
Conversation
This commit introduces a new function, is_appellate_court(), which determines whether a given court ID belongs to an appellate court. This function is useful for filtering and categorizing courts based on their jurisdiction.
d0e6952
to
f5c8286
Compare
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 pretty OK to me, though I might have expected another test or two, but that's not based on any knowledge of what tests we already have, just a thought.
I appreciate the addition of the helper function and the small tweaks to use it too. We should do more of this as we see these kinds of things. (It's OK to have their own PR too, if they're bigger and worth it.)
Onward to full review. :)
Thanks!
cl/corpus_importer/tasks.py
Outdated
att_report = AttachmentPage(pacer_court_id, s) | ||
att_report.query(rd.pacer_doc_id) | ||
if is_appellate_court(pacer_court_id): | ||
att_report = AppellateAttachmentPage(pacer_court_id, s) | ||
else: | ||
att_report = AttachmentPage(pacer_court_id, s) |
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.
While testing this with a real Fetch request, I noticed it was failing at this part:
It worked after applying this tweak:
att_report = AttachmentPage(pacer_court_id, s) | |
att_report.query(rd.pacer_doc_id) | |
if is_appellate_court(pacer_court_id): | |
att_report = AppellateAttachmentPage(pacer_court_id, s) | |
else: | |
att_report = AttachmentPage(pacer_court_id, s) | |
if is_appellate_court(pacer_court_id): | |
att_report = AppellateAttachmentPage(pacer_court_id, s) | |
else: | |
att_report = AttachmentPage(pacer_court_id, s) | |
att_report.query(rd.pacer_doc_id) |
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.
You're correct. Thanks!
Thanks @ERosendo this looks about right! In addition to my comments above:
|
One last comment, as we discussed on Slack:
|
- Adds a new test to validate appellate court logic for fetching attachment pages. - Refines the existing test for district courts. - Removes the unnecessary fixture from RecapAttPageFetchApiTest.
4d11b86
to
05550e8
Compare
Thanks for your review @albertisfu
This makes perfect sense. I checked Juriscraper and discovered that the ACMSAttachmentPage class lacks an implementation for the query method. Furthermore, I recalled that the extension currently does not send HTML data for ACMS cases. Instead, it sends JSON. Therefore, we need to determine if it's possible to query ACMS court data and receive a JSON response. If this direct JSON retrieval is not possible, we should also implement a method to parse the necessary data from the HTML response. |
Can I suggest that we put the error message in place and make an issue for ACMS support for the next sprint? |
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.
Thanks @ERosendo changes look great!
Key changes.
Introduces a new function,
is_appellate_court
, which determines whether a given court ID belongs to an appellate court. This helper improves code readability and maintainability by adhering to the DRY principle.Updates the
fetch_attachment_page
task and theget_att_report_by_rd
method to support appellate attachment pages.fixes #4862