Skip to content
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

DocketReport: handle 'Date Entered' option #227

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

johnhawkinson
Copy link
Contributor

@johnhawkinson johnhawkinson commented Jun 7, 2018

DocketReport: handle 'Date Entered' option

A PACER docket report can be run with either 'Date Entered' or 'Date
Filed' dates. Previous code assumed, roughly, "A date is a date,"
but that's not so.

It's common for the date entered to lag the date filed by a day, and
then that means different people who run the docket report with
different values for that radio button would cause different dates to
appear in the CL date_filed field.

So here we check the column heading of the first column against
several known choices, or we throw an exception if it doesn't make
sense.

We broaden the CELL_XPATH expression to include <th> as well as <td>,
since in a few BK cases that's required.

We also normalize the column heading whitespace with a helper function
normalize_whitespace() that arguably could live elsewhere.

There's some ambiguity about what 'Docket Date' means (is it filing or
entering?), but since it only appears historically, we'll place it
where we have always done so -- as the date_filed.

This needs freelawproject/courtlistener#840 which adds support for
the new date_entered field.

flake8 juriscraper/pacer/docket_report.py
juriscraper/pacer/docket_report.py:96:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:142:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:166:80: E501 line too long (83 > 79 characters)
juriscraper/pacer/docket_report.py:168:80: E501 line too long (88 > 79 characters)
juriscraper/pacer/docket_report.py:174:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:176:80: E501 line too long (95 > 79 characters)
juriscraper/pacer/docket_report.py:184:80: E501 line too long (86 > 79 characters)
juriscraper/pacer/docket_report.py:198:80: E501 line too long (91 > 79 characters)
juriscraper/pacer/docket_report.py:201:80: E501 line too long (98 > 79 characters)
juriscraper/pacer/docket_report.py:206:80: E501 line too long (96 > 79 characters)
juriscraper/pacer/docket_report.py:208:80: E501 line too long (110 > 79 characters)
juriscraper/pacer/docket_report.py:212:80: E501 line too long (107 > 79 characters)
juriscraper/pacer/docket_report.py:319:80: E501 line too long (82 > 79 characters)
juriscraper/pacer/docket_report.py:336:80: E501 line too long (87 > 79 characters)
juriscraper/pacer/docket_report.py:338:80: E501 line too long (92 > 79 characters)
juriscraper/pacer/docket_report.py:366:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:483:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:684:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:695:80: E501 line too long (84 > 79 characters)
juriscraper/pacer/docket_report.py:718:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:724:80: E501 line too long (96 > 79 characters)
juriscraper/pacer/docket_report.py:728:15: E131 continuation line unaligned for hanging indent
juriscraper/pacer/docket_report.py:754:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:794:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:797:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:893:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:912:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:931:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:947:80: E501 line too long (80 > 79 characters)
juriscraper/pacer/docket_report.py:1057:1: E305 expected 2 blank lines after class or function definition, found 1
Use a constant, CELL_XPATH, for finding cells in the table

Don't exclude header rows from `docket_entry_rows`.

These lend clarity to the next commit.
A PACER docket report can be run with either 'Date Entered' or 'Date
Filed' dates.  Previous code assumed, roughly, "A date is a date,"
but that's not so.

It's common for the date entered to lag the date filed by a day, and
then that means different people who run the docket report with
different values for that radio button would cause different dates to
appear in the CL `date_filed` field.

So here we check the column heading of the first column against
several known choices, or we throw an exception if it doesn't make
sense.

We broaden the CELL_XPATH expression to include <th> as well as <td>,
since in a few BK cases that's required.

We also normalize the column heading whitespace with a helper function
normalize_whitespace() that arguably could live elsewhere.

There's some ambiguity about what 'Docket Date' means (is it filing or
entering?), but since it only appers historically, we'll place it
where we have always done so -- as the `date_filed`.

This needs freelawproject/courtlistener#840 which adds support for
the new `date_entered` field.
@mlissner
Copy link
Member

mlissner commented Jun 7, 2018

Can you pull out the pep8 stuff in a separate PR? I'm afraid I'll miss something with it all mixed together like this.

@johnhawkinson
Copy link
Contributor Author

It turns out I missed something important: regardless of which variety of the report is run, there is a parenthesized note at the end that gives the Date Entered:

screen shot 2018-06-08 at 17 25 46

So this code should probably [attempt to?] parse that, too.

Throw an assertion if it differs from the Date Entered column.

But in the normal case, we'll get Date Filed from the first column and
Date Entered from the end of the description's parenthetical note.
@CLAassistant
Copy link

CLAassistant commented Dec 18, 2021

CLA assistant check
All committers have signed the CLA.

@flooie
Copy link
Contributor

flooie commented Dec 18, 2021

@johnhawkinson is this worth finishing?

@mlissner
Copy link
Member

This is worth doing, yes, but I don't know where we'll prioritize it. If John does it, we'll merge it, but I don't think it's high on our list otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants