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: import metrics with extra #15047

Merged
merged 2 commits into from
Jun 9, 2021
Merged

Conversation

betodealmeida
Copy link
Member

SUMMARY

When importing a dataset, if a metric has extra = {} it doesn't get serialized to a string because it doesn't meet the condition if metric.get("extra"). I fixed it by being explicit and checking if metric.get("extra") is not None.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Updated unit test to cover this case. Tested with dashboard that was not working before.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #15047 (e819ced) into master (b75df93) will increase coverage by 0.23%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15047      +/-   ##
==========================================
+ Coverage   77.55%   77.78%   +0.23%     
==========================================
  Files         966      966              
  Lines       49624    49628       +4     
  Branches     6314     6314              
==========================================
+ Hits        38485    38605     +120     
+ Misses      10938    10822     -116     
  Partials      201      201              
Flag Coverage Δ
hive 81.42% <50.00%> (?)
mysql 81.70% <50.00%> (-0.01%) ⬇️
postgres 81.73% <50.00%> (-0.01%) ⬇️
presto 81.42% <50.00%> (?)
python 82.25% <50.00%> (+0.44%) ⬆️
sqlite 81.34% <50.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/datasets/commands/importers/v1/utils.py 58.97% <50.00%> (+1.83%) ⬆️
superset/utils/core.py 89.04% <0.00%> (+0.12%) ⬆️
superset/utils/mock_data.py 25.18% <0.00%> (+0.18%) ⬆️
superset/models/core.py 90.00% <0.00%> (+0.26%) ⬆️
superset/db_engine_specs/base.py 88.37% <0.00%> (+0.40%) ⬆️
superset/connectors/sqla/models.py 89.81% <0.00%> (+1.65%) ⬆️
superset/views/database/mixins.py 82.75% <0.00%> (+1.72%) ⬆️
superset/db_engine_specs/presto.py 90.31% <0.00%> (+6.94%) ⬆️
superset/db_engine_specs/hive.py 87.39% <0.00%> (+17.07%) ⬆️
superset/db_engines/hive.py 82.14% <0.00%> (+82.14%) ⬆️

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 b75df93...e819ced. Read the comment docs.

@betodealmeida betodealmeida merged commit 42cb526 into apache:master Jun 9, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* fix: import metrics with extra

* Fix test
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* fix: import metrics with extra

* Fix test
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* fix: import metrics with extra

* Fix test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.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/XS 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants