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: native annotations #10037

Merged
merged 3 commits into from Jun 12, 2020

Conversation

villebro
Copy link
Member

@villebro villebro commented Jun 11, 2020

SUMMARY

Native annotations are currently broken due to regressions in recent PRs:

BEFORE

Bug number 1: RLS breaks annotations as they only apply to SQL datasources if ENABLE_ROW_LEVEL_SECURITY is enabled:
image

Bug number 2: The id of the annotation layer was dropped in #9888 , hence can't be selected:
captured (1)

AFTER

image
captured (2)

TEST PLAN

Local testing + new test + CI

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

@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2020

Codecov Report

Merging #10037 into master will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10037      +/-   ##
==========================================
- Coverage   68.91%   68.85%   -0.06%     
==========================================
  Files         584      584              
  Lines       31047    31056       +9     
  Branches     3180     3180              
==========================================
- Hits        21395    21384      -11     
- Misses       9543     9563      +20     
  Partials      109      109              
Flag Coverage Δ
#cypress 53.92% <ø> (ø)
#javascript 59.48% <ø> (ø)
#python 67.26% <100.00%> (-0.10%) ⬇️
Impacted Files Coverage Δ
superset/common/query_context.py 79.37% <ø> (ø)
superset/connectors/base/models.py 86.47% <100.00%> (+0.04%) ⬆️
superset/connectors/sqla/models.py 88.80% <100.00%> (-0.15%) ⬇️
superset/views/annotations.py 80.43% <100.00%> (ø)
superset/viz.py 57.03% <100.00%> (-0.03%) ⬇️
superset/db_engine_specs/mysql.py 78.26% <0.00%> (-13.05%) ⬇️
superset/models/core.py 85.42% <0.00%> (-0.88%) ⬇️
superset/views/core.py 75.18% <0.00%> (-0.22%) ⬇️
superset/errors.py 100.00% <0.00%> (ø)
... and 2 more

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 8744dad...e391aca. Read the comment docs.

@villebro
Copy link
Member Author

I propose merging this as-is, and adding more comprehensive tests later if we refactor annotations (I hadn't worked extensively with the annotation code before, but it seems to be in need of some refactoring at some point).

@@ -103,7 +103,7 @@ class AnnotationLayerModelView(SupersetModelView): # pylint: disable=too-many-a
add_title = _("Add Annotation Layer")
edit_title = _("Edit Annotation Layer")

list_columns = ["name", "descr"]
list_columns = ["id", "name", "descr"]
Copy link
Member Author

Choose a reason for hiding this comment

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

This will make the CRUD view slightly uglier with the id, but is necessary based on discussions with @dpgaspar

@villebro villebro changed the title fix: native annotations broken fix: native annotations Jun 11, 2020
@villebro villebro merged commit a3393c1 into apache:master Jun 12, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* fix: native annotations

* Add test

* Add comment to test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Mar 12, 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 size/S 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants