ad-m opened a new pull request #18170: URL: https://github.com/apache/superset/pull/18170
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY During review #18151 there was a comment about code duplication of snippet like: ```python if not request.is_json: raise InvalidPayloadFormatError("Request is not JSON") ``` > Do we have a decorator for this? Might want to add one if not yet. _Originally posted by @ktmud in https://github.com/apache/superset/pull/18151#discussion_r791180093_ I would like to get familiar with part of the codebase of the project written in Python, so I perceived that as a good first issue for a new contributor. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> N/A ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> Python test handle all scenarios. I added a new one integration tests to verify behaviour of extracted decorator. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: #18151 - [ ] Required feature flags: NO - [ ] Changes UI: NO - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)): NO - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API: NO - [ ] Removes existing feature or API: NO @ktmud, @michael-s-molina Can I request reviews? I am aware this is a trivial change, but I want to try to grab the project style & structure to be able to make bigger changes, and the beginning has to be somewhere. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
