fix(tags): tags api change tag_get_objects method to be aligned with api documentation
SUMMARY
I just came across an issue where the implemented logic was not aligned with the API documentation on OpenAPI. As a result, the method was not usable. I modified the method to align with the documentation, although I saw a benefit in the initial implementation of a better filter mechanism and bulk requests. I think a breaking change should be discussed first; therefore, I removed the non-functional code here, so that we have a fixed api soon.
TESTING INSTRUCTIONS
Start up superset and use the tags/get_objects/<tag_id> method it now should return the charts that belong to a tag.
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] 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
- [ ] Removes existing feature or API
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 84.98%. Comparing base (
76d897e) to head (2237978). Report is 1774 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #29338 +/- ##
===========================================
+ Coverage 60.48% 84.98% +24.49%
===========================================
Files 1931 564 -1367
Lines 76236 53891 -22345
Branches 8568 0 -8568
===========================================
- Hits 46114 45797 -317
+ Misses 28017 8094 -19923
+ Partials 2105 0 -2105
| Flag | Coverage Δ | |
|---|---|---|
| hive | 49.21% <ø> (+0.06%) |
:arrow_up: |
| javascript | ? |
|
| mysql | 77.62% <ø> (?) |
|
| postgres | 77.70% <ø> (?) |
|
| presto | 53.96% <ø> (+0.16%) |
:arrow_up: |
| python | 84.98% <ø> (+21.47%) |
:arrow_up: |
| sqlite | 77.20% <ø> (?) |
|
| unit | 62.03% <ø> (+4.40%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
The existing endpoint should work, you just need to pass it a single Tag ID in the list, rather than a longer list of tag IDs.
This would be a breaking change, as you're removing support for supplying the API with multiple Tag IDs.
The real change we need to make is to the documentation. The docs say the API expects tag_id (int) but in fact, it's expecting tagIds (array). We should probably just update the docs since the API supports all of the above use cases.
@rusackas, thanks for your feedback. I think somehow you have a point here. I thought it was the correct way to change the behavior as the OpenAPI specification is a public interface and expects a totally different variable type here: int vs array, different name, and different type: path vs parameter. But for me, it is also fine to consider that the bug is that the API is not properly documented and to fix this. I will hand something in for it.
I adapted the documentation as discussed above: @rusackas @dpgaspar please have a look :)
Closing/reopening to get CI running again. Hopefully it'll pass so we can review/merge. Sorry this has been stuck so long!
Looks like CI still isn't happy... at least pre-commit for starters.
Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:
pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.
Alternatively it is possible to run pre-commit by running pre-commit manually:
pre-commit run --all-files
I've converted this to draft for now while it awaits touchups. If it doesn't get them, it may eventually be closed.