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 for tagging backend #7240

Merged
merged 1 commit into from
Apr 8, 2019
Merged

Fix for tagging backend #7240

merged 1 commit into from
Apr 8, 2019

Conversation

betodealmeida
Copy link
Member

SUMMARY

This PR has bug fixes for the tagging backend, and a few improvements on the SQLAlchemy queries used by it.

The tags model has a clowny bug 🤡where the type of tags was being set incorrectly in the parent class (see superset/models/tags.py below). This should fix all the weird problems that were happening with tags (new charts starting with tags, and wrong objects showing up in the tag search).

For the SQLAlchemy queries, I rewrote them to use explicit joins (to avoid accidents with cross joins), and also made the logic more clear.

TEST PLAN

I created charts and dashboards, tagged them, and verified that everything is working as expected.

ADDITIONAL INFORMATION
[ ] Has associated issue:
[ ] Changes UI
[ ] Requires DB Migration. Confirm DB Migration upgrade and downgrade tested.
[ ] Introduces new feature or API
[ ] Removes existing feature or API
[x] Fixes bug
[x] Refactors code
[ ] Adds test(s)
REVIEWERS

@xtinec (this might cause merge conflicts with our private cherry, LMK if you need help fixing it)
@khtruong
@datability-io

@betodealmeida betodealmeida added !deprecated-label:bug Deprecated label - Use #bug instead change:backend Requires changing the backend #code-quality lyft Related to Lyft labels Apr 8, 2019
@@ -123,7 +123,7 @@ def _add_owners(cls, session, target):
tagged_object = TaggedObject(
tag_id=tag.id,
object_id=target.id,
object_type=ObjectTypes.chart,
object_type=cls.object_type,
Copy link
Member Author

Choose a reason for hiding this comment

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

shame

@codecov-io
Copy link

Codecov Report

Merging #7240 into lyftga will increase coverage by 0.04%.
The diff coverage is 6.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           lyftga    #7240      +/-   ##
==========================================
+ Coverage   64.49%   64.53%   +0.04%     
==========================================
  Files         425      425              
  Lines       20879    20861      -18     
  Branches     2280     2280              
==========================================
- Hits        13466    13463       -3     
+ Misses       7287     7272      -15     
  Partials      126      126
Impacted Files Coverage Δ
superset/models/tags.py 90.09% <ø> (ø) ⬆️
superset/views/tags.py 42.5% <6.66%> (+4.74%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74bdc32...7c34c24. Read the comment docs.

@khtruong
Copy link
Contributor

khtruong commented Apr 8, 2019

LGTM

@betodealmeida betodealmeida merged commit c6876f7 into apache:lyftga Apr 8, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead lyft Related to Lyft 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants