Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tags): tags api change tag_get_objects method to be aligned with api documentation #29338

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Bierbarbar
Copy link

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

@github-actions github-actions bot added the api Related to the REST API label Jun 24, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@Bierbarbar Bierbarbar changed the title fix(tags): api change tag_get_objects method to be aligned with api documentation fix(tags): tags api change tag_get_objects method to be aligned with api documentation Jun 24, 2024
@rusackas rusackas requested a review from dpgaspar June 24, 2024 17:23
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.75%. Comparing base (76d897e) to head (2237978).
Report is 364 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29338       +/-   ##
===========================================
+ Coverage   60.48%   83.75%   +23.26%     
===========================================
  Files        1931      518     -1413     
  Lines       76236    37624    -38612     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31512    -14602     
+ Misses      28017     6112    -21905     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.90% <ø> (-0.26%) ⬇️
javascript ?
mysql 77.27% <ø> (?)
postgres 77.40% <ø> (?)
presto 53.51% <ø> (-0.30%) ⬇️
python 83.75% <ø> (+20.26%) ⬆️
sqlite 76.85% <ø> (?)
unit 59.20% <ø> (+1.58%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas
Copy link
Member

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.

@Bierbarbar
Copy link
Author

@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.

@Bierbarbar
Copy link
Author

I adapted the documentation as discussed above:
@rusackas @dpgaspar please have a look :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants