Search fails to find the firm
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 62
- Avg merge
- 24m
- Merged PRs (30d)
- 1
Description
following error is seen in legal api logs for FM0346897
```
2022-09-27 23:49:09,512 - legal_api - ERROR in app:app.py:1891 - log_exception: Exception on /api/v1/businesses/FM0346897 [GET]
Traceback (most recent call last):
File "/opt/app-root/src/legal_api/resources/v1/business/business.py", line 59, in get
return jsonify(business=business.json())
File "/opt/app-root/src/legal_api/models/business.py", line 371, in json
LegislationDatetime.as_legislation_timezone(self.last_coa_date)
File "/opt/app-root/src/legal_api/utils/legislation_datetime.py", line 43, in as_legislation_timezone
return date_time.astimezone(pytz.timezone(current_app.config.get('LEGISLATIVE_TIMEZONE')))
File "/usr/local/lib/python3.8/site-packages/pytz/tzinfo.py", line 201, in fromutc
return (dt + inf[0]).replace(tzinfo=self._tzinfos[inf])
OverflowError: date value out of range
```
SOFI supports this unknown date

Contributor guide
No contributing guide indexed for this repository
Research direction
Start with legal_api/resources/v1/business/business.py, legal_api/models/business.py, and legal_api/utils/legislation_datetime.py, then reproduce GET /api/v1/businesses/FM0346897 using the traceback and the unknown-date example. Trace how last_coa_date is serialized and define handling that avoids the OverflowError while preserving the business response; verify the endpoint no longer fails for this record.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, postgres, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100