Azure / Azure/azure-functions-python-library
Inconsistent naming get_json() in EventGridEvent and EventGridOutputEvent
- Dominant language
- Python
- Stars
- 179
- Forks
- 79
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 2
Description
Both mentioned classes have methods called `get_json` which return the classes `__data` field. This seems odd for two reasons:
1. They don't actually return JSON but a dict (if the typing hints in `__init__` are correct). In any case this is a major source of confusion.
2. All other getters are implemented as properties. (So why not just do the same here?)
https://github.com/Azure/azure-functions-python-library/blob/44712a77ce6ba68065d1c16ed6015bb998ddfe48/azure/functions/_eventgrid.py#L33-L34
https://github.com/Azure/azure-functions-python-library/blob/44712a77ce6ba68065d1c16ed6015bb998ddfe48/azure/functions/_eventgrid.py#L86-L87
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in azure/functions/_eventgrid.py at lines 33-34 and 86-87, then compare these accessors with the other getters on EventGridEvent and EventGridOutputEvent. Resolve the naming and property behavior consistently, while confirming that the resulting API reflects whether the value is a dict rather than JSON.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, cloud
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100