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

chore(dao): Organize DAOs according to SIP-92 #24331

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Jun 8, 2023

SUMMARY

This PR is the first of many to related to SIP-92 Proposal for restructuring the Python code base. Specifically it organizes all the DAOs under the superset/daos subfolder. A few things of note:

  1. The EmbeddedDAO was renamed EmbeddedDashboardDAO for clarity.
  2. The organization is flat from a directory standpoint (akin to @ktmud's suggestion in the SIP) as opposed to tiered. This means that there was consolidation of DAOs by theme:
  • AnnotationLayerDAO is housed in daos/annotation.py
  • EmbeddedDashboardDAO and FilterSetDAO are housed in daos/dashboard.py
  • SavedQueryDAO is housed in daos/query.py
  • SSHTunnelDAO is housed in daos/database.py
  1. It wasn't overly clear whether the modules should use singular or plural forms, i.e., dashboard or dashboards. I opted for the former given that:
  • They're already housed under daos (plural) subfolder.
  • Even though the dashboard.py file contains a collection of DAOs (DashboardDAO, EmbeddedDashboardDAO) we tend to think of the term "dashboard" as a concept/type rather than multiple types.
  • It seems prudent to stick with either singular or plural from a consistency standpoint—the one exception is (no pun intended) exceptions as this houses different exception types and is consistent with how other files containing exceptions are named.
  1. Apart from singularizing the terms the follow renames occurred:
  • css_templates/dao.py became daos/css.py
  • row_level_security/dao.py became daos/security.py

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI.

ADDITIONAL INFORMATION

  • Has associated issue: [SIP-92] Proposal for restructuring the Python code base #20630
  • 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

@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Merging #24331 (a16096e) into master (38ff5d3) will decrease coverage by 0.02%.
The diff coverage is 95.11%.

❗ Current head a16096e differs from pull request most recent head aafa73c. Consider uploading reports for the commit aafa73c to get more accurate results

@@            Coverage Diff             @@
##           master   #24331      +/-   ##
==========================================
- Coverage   68.93%   68.91%   -0.02%     
==========================================
  Files        1904     1899       -5     
  Lines       73878    73842      -36     
  Branches     8119     8119              
==========================================
- Hits        50927    50891      -36     
  Misses      20840    20840              
  Partials     2111     2111              
Flag Coverage Δ
hive 53.90% <79.69%> (-0.05%) ⬇️
mysql 79.23% <94.73%> (-0.03%) ⬇️
postgres 79.32% <94.73%> (-0.03%) ⬇️
presto 53.81% <79.69%> (-0.05%) ⬇️
python 83.31% <95.11%> (-0.02%) ⬇️
sqlite 77.81% <93.60%> (-0.03%) ⬇️
unit 54.60% <79.69%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
superset-frontend/src/pages/DatabaseList/index.tsx 65.13% <ø> (-0.32%) ⬇️
superset/commands/importers/v1/examples.py 0.00% <0.00%> (ø)
superset/common/query_object_factory.py 91.89% <0.00%> (ø)
superset/daos/exceptions.py 100.00% <ø> (ø)
superset/sqllab/sql_json_executer.py 74.39% <0.00%> (ø)
superset/sqllab/commands/execute.py 89.07% <33.33%> (ø)
superset/daos/query.py 95.23% <83.33%> (ø)
superset/daos/annotation.py 87.75% <85.00%> (ø)
superset/daos/dashboard.py 96.74% <94.59%> (ø)
...otation_layers/annotations/commands/bulk_delete.py 87.50% <100.00%> (ø)
... and 106 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@john-bodley john-bodley force-pushed the john-bodley--sip-92-daos branch 4 times, most recently from d72160e to d330219 Compare June 9, 2023 05:05
Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

This is great!

"one exception is exceptions" :)

@john-bodley john-bodley changed the title chore(daos): Organize DAOs according to SIP-92 chore(dao): Organize DAOs according to SIP-92 Jun 18, 2023
@john-bodley john-bodley merged commit 3e76736 into apache:master Jun 19, 2023
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/XL 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants