codeforboston / codeforboston/voiceapp311

Address is None on latest_311_intent

Open
#313 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
40
Forks
46
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
While playing with the service I noticed that the Address is not always returned on the 311 Intent.
Below is an example of a returned 311 Intent Card. You can see that the second Address is **None**.

> Here are the 3 latest three one one reports: There was a request at 107 Needham Rd for the Animal Control to address Animal Lost. There was a request at None for the Mayor's 24 Hour Hotline to address General Comments For An Employee. There was a request at 195 Brunswick St for the Inspectional Services to address Building Inspection Request.

A simple fix to this would be to add conditionals on the `build_speech_from_311_report` method
line 108 of latest_311_intent.py
```
subject = report["subject"] if report["subject"] else '311 support'
report_type = report["type"] if report["type"] else 'Unknown issue'
location = report["location_street_name"] if report["location_street_name"] else 'Unknown Street'
```

Also adding an extra \n\n after each issue on the return card will make it look a little prettier.

> Here are the 3 latest three one one reports:
>
>There was a request at 107 Needham Rd for the Animal Control to address Animal Lost.
>
>There was a request at None for the Mayor's 24 Hour Hotline to address General Comments For An Employee.
>
>There was a request at 195 Brunswick St for the Inspectional Services to address Building Inspection Request.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open latest_311_intent.py and inspect build_speech_from_311_report around line 108. Verify how missing subject, type, and location_street_name values are rendered, and review the returned 311 Intent Card formatting. Done means missing values use the proposed fallback text and separate reports have the requested extra blank lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.