CARLI / web-reports

Web Reports Web Based Reporting Tool
2 stars 0 forks source link

Error when "Show All" in results of "Unexpired patrons with inactive email addresses" #123

Open jenhm opened 7 years ago

jenhm commented 7 years ago

For UIU "Unexpired patrons with inactive email addresses" yields 614 hits. When I attempt to "Show All" I get the "DataTables Warning:table id=d-tables - Ajax error. For more information about this error, please see http://datatables.net/tn/7" error. It is worth noting that I can select to view 100 records, and when I "Show All" in a result list from DPU (402), UIC (100 hits), or SIC (69 hits) I do not receive the error.

Additionally, attempting to sort the results by "Patron Record Expire Date" causes the same error, regardless of the number of results/database searched.

patrickzurek commented 7 years ago

The backend is throwing an exception because the Python standard library function that converts a datetime to string does not support years before 1900 and there is a row result/patron in UIU's result set that has the year 1111 in one of its date fields.

We can find an alternative to the standard library function used. It looks like we have a couple options available to us of varying degrees of complexity and fitness. Also, there will be effort involved on our side searching through the Oracle output for offending dates (I believe we don't need to do this for every report, just those that fail the initial pass through the original time string formatting function).

Alternately, or even as just a temporary measure so that we can push this report to production sooner and implement a full fix later, I can just catch the exception when it happens and not actually do any string conversion on that date. We'd have to decide what to display.. something like NULL? Invalid Date. I don't know.

The last idea is not appealing to me but maybe you all have different thoughts. I imagine if a user has 1111 for a date's year, the report viewer might want to know that.