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

feat: add logic to creation_method for reports schedule #15685

Merged
merged 10 commits into from
Jul 16, 2021

Conversation

AAfghahi
Copy link
Member

SUMMARY

We are creating a feature were users can create reports on either the charts or the dashboard page, in order to track where these are created we are adding a new column called creation_method.

The migration can be seen #15683

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Added tests in the reports_schedule api_tests.py

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

@AAfghahi AAfghahi requested a review from a team as a code owner July 14, 2021 16:40
@AAfghahi AAfghahi mentioned this pull request Jul 14, 2021
7 tasks
@AAfghahi AAfghahi force-pushed the arash/reportsMigrationLogic branch from f4c4692 to 1ca3b03 Compare July 14, 2021 16:45
@@ -74,6 +74,12 @@ class ReportDataFormat(str, enum.Enum):
DATA = "CSV"


class ReportCreationMethodType(str, enum.Enum):
CHARTS = "charts"
DASHBOARD = "dashboard"
Copy link
Member

@eschutho eschutho Jul 14, 2021

Choose a reason for hiding this comment

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

nit, but this is the only singular value. How about chart, dashboard, alert_report?

Copy link
Member Author

Choose a reason for hiding this comment

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

changed all to plural.

@codingdud
Copy link

gfgjhcvhjvlugg

@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

Merging #15685 (2c450f0) into master (7dd3af6) will decrease coverage by 0.22%.
The diff coverage is 100.00%.

❗ Current head 2c450f0 differs from pull request most recent head 29537a1. Consider uploading reports for the commit 29537a1 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15685      +/-   ##
==========================================
- Coverage   76.91%   76.68%   -0.23%     
==========================================
  Files         983      983              
  Lines       51583    51593      +10     
  Branches     6979     6979              
==========================================
- Hits        39673    39565     -108     
- Misses      11688    11806     +118     
  Partials      222      222              
Flag Coverage Δ
hive ?
mysql 81.54% <100.00%> (+<0.01%) ⬆️
postgres 81.56% <100.00%> (+<0.01%) ⬆️
presto ?
python 81.65% <100.00%> (-0.44%) ⬇️
sqlite 81.17% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...set-frontend/src/components/ListViewCard/index.tsx 100.00% <100.00%> (ø)
superset/models/reports.py 100.00% <100.00%> (ø)
superset/reports/api.py 87.78% <100.00%> (ø)
superset/reports/schemas.py 98.71% <100.00%> (+0.06%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.44% <0.00%> (-17.07%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-6.95%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.26% <0.00%> (-1.65%) ⬇️
superset/db_engine_specs/base.py 88.28% <0.00%> (-0.40%) ⬇️
... 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 7dd3af6...29537a1. Read the comment docs.

@AAfghahi AAfghahi force-pushed the arash/reportsMigrationLogic branch from 989816b to 85c42da Compare July 14, 2021 18:12
@AAfghahi AAfghahi force-pushed the arash/reportsMigrationLogic branch 5 times, most recently from 0375321 to 89ebc7e Compare July 15, 2021 17:02
@github-actions
Copy link
Contributor

⚠️ @AAfghahi Your base branch master has just also updated superset/migrations.

Please consider rebasing your branch to avoid db migration conflicts.

@AAfghahi AAfghahi force-pushed the arash/reportsMigrationLogic branch from 89ebc7e to 2506a6b Compare July 15, 2021 20:43
@AAfghahi AAfghahi force-pushed the arash/reportsMigrationLogic branch from 2506a6b to aa5eaaa Compare July 15, 2021 20:44
Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Nice! I just left some minor comments.

superset/models/reports.py Outdated Show resolved Hide resolved
superset/reports/schemas.py Outdated Show resolved Hide resolved
creation_method = EnumField(
ReportCreationMethodType,
by_value=True,
required=False,
Copy link
Member

Choose a reason for hiding this comment

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

This will default to ALERTS_REPORTS if the field is missing, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, so should I make it required?

tests/integration_tests/reports/api_tests.py Outdated Show resolved Hide resolved
AAfghahi and others added 3 commits July 15, 2021 18:25
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
@AAfghahi AAfghahi force-pushed the arash/reportsMigrationLogic branch from 56e3f6a to 95b1e65 Compare July 15, 2021 22:47
@AAfghahi AAfghahi force-pushed the arash/reportsMigrationLogic branch from 95b1e65 to 29537a1 Compare July 15, 2021 23:20
@betodealmeida betodealmeida merged commit 674f234 into apache:master Jul 16, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* migration

* added logic for creation_method

* revisions

* added index

* Update superset/migrations/versions/3317e9248280_add_creation_method_to_reports_model.py

* filters

* Update superset/models/reports.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update superset/reports/schemas.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update tests/integration_tests/reports/api_tests.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* revisions

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* migration

* added logic for creation_method

* revisions

* added index

* Update superset/migrations/versions/3317e9248280_add_creation_method_to_reports_model.py

* filters

* Update superset/models/reports.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update superset/reports/schemas.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update tests/integration_tests/reports/api_tests.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* revisions

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* migration

* added logic for creation_method

* revisions

* added index

* Update superset/migrations/versions/3317e9248280_add_creation_method_to_reports_model.py

* filters

* Update superset/models/reports.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update superset/reports/schemas.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update tests/integration_tests/reports/api_tests.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* revisions

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
@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 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants