[BUG] Wrong typing in Client.insights.v1.rooms.list
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start from the RoomInstance definition behind Client.insights.v1.rooms.list, likely in the generated insights room resource, and compare its payload.get(...) assignments with the Video Log Analyzer Room Summary properties linked in the issue. Check whether these models are generated from the twilio-oai spec, since the durable fix may belong there and then be regenerated. Done when the documented non-optional fields are typed as required and the relevant insights tests still pass.
Written by the indexing model from the issue text.
Description
Describe the bug
Client.insights.v1.rooms.list returns a list[RoomInstance]. But there is an issue with RoomInstance types, all the fields of that RoomInstance are optional. Are there any reason why they marked optional?
Code snippet
class RoomInstance:
self.account_sid: Optional[str] = payload.get("account_sid")
self.room_sid: Optional[str] = payload.get("room_sid")
self.room_name: Optional[str] = payload.get("room_name")
self.create_time: Optional[datetime] = deserialize.iso8601_datetime(
payload.get("create_time")
)
self.end_time: Optional[datetime] = deserialize.iso8601_datetime(
payload.get("end_time")
)
Actual behavior
According to your API docs, Room fields are not optional: https://www.twilio.com/docs/video/troubleshooting/video-log-analyzer-api#room-summary-resource-properties
But according to the code, they all are optional:
Expected behavior
All the fields should not be Optional
twilio-python version
9.13.0
Python version
3.9.11
Logs or error messages
No response
Additional context
No response
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 821
- Avg merge
- 9h 33m
- Merged PRs (30d)
- 3
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from twilio/twilio-python
-
Docs: "Handling Exceptions" should mention that network errors are not `TwilioRestException`Possibly taken @henricop claimed this 13 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
twilio/twilio-python#986 · 1 comment ·
Maintainers usually reply within 1 day
-
Clearer diagnostic when an API Key SID is passed without `account_sid`Possibly taken @saryeljaramany claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
twilio/twilio-python#985 · 1 comment ·
Maintainers usually reply within 1 day
-
TokenPagination.next_page_async() makes a sync request and fails with an async http clientPossibly taken @sebxt claimed this 31 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
twilio/twilio-python#976 ·
Maintainers usually reply within 1 day
-
AsyncTwilioHttpClient does not JSON-serialize request bodies for application/json endpoints (sync client does) → 400 on JSON-body v2 endpointsPossibly taken @Steve0x2a claimed this 77 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
twilio/twilio-python#932 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
twilio/twilio-python#930 ·
Maintainers usually reply within 1 day
All issues in twilio/twilio-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
area:cli area:security enhancement priority:medium size:small
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
RonaldHensbergen/composable-data-stack#1338 ·
Maintainers usually reply within 1 day
-
area:stdlib effort:S impact:med platform:linux type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
automated endpoint-dead needs-curation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
almanac-data/climate-almanac#139 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/inspect_ai#6695 · 1 comment ·
Maintainers usually reply within 1 day