graph LR
Application_Core_Infrastructure["Application Core & Infrastructure"]
Web_API_User_Interface["Web API & User Interface"]
Business_Logic_Commands["Business Logic & Commands"]
Data_Persistence_Database_Integration["Data Persistence & Database Integration"]
SQL_Query_Data_Processing["SQL Query & Data Processing"]
Security_Access_Control["Security & Access Control"]
Asynchronous_Tasks_Reporting["Asynchronous Tasks & Reporting"]
System_Management_Data_Lifecycle["System Management & Data Lifecycle"]
Tagging_System["Tagging System"]
Application_Core_Infrastructure -- "initializes and configures" --> Web_API_User_Interface
Application_Core_Infrastructure -- "initializes and configures" --> Data_Persistence_Database_Integration
Application_Core_Infrastructure -- "initializes and configures" --> Security_Access_Control
Application_Core_Infrastructure -- "initializes and configures" --> Asynchronous_Tasks_Reporting
Application_Core_Infrastructure -- "provides services to" --> Web_API_User_Interface
Application_Core_Infrastructure -- "provides services to" --> Data_Persistence_Database_Integration
Application_Core_Infrastructure -- "provides services to" --> SQL_Query_Data_Processing
Application_Core_Infrastructure -- "provides services to" --> Business_Logic_Commands
Application_Core_Infrastructure -- "provides services to" --> Security_Access_Control
Application_Core_Infrastructure -- "provides services to" --> Asynchronous_Tasks_Reporting
Application_Core_Infrastructure -- "provides services to" --> System_Management_Data_Lifecycle
Application_Core_Infrastructure -- "provides services to" --> Tagging_System
Web_API_User_Interface -- "invokes" --> Business_Logic_Commands
Web_API_User_Interface -- "enforces access via" --> Security_Access_Control
Web_API_User_Interface -- "displays data from" --> SQL_Query_Data_Processing
Web_API_User_Interface -- "interacts with" --> Tagging_System
Business_Logic_Commands -- "executes operations by interacting with" --> Data_Persistence_Database_Integration
Business_Logic_Commands -- "uses for SQL manipulation" --> SQL_Query_Data_Processing
Business_Logic_Commands -- "triggers background tasks in" --> Asynchronous_Tasks_Reporting
Business_Logic_Commands -- "enforces access via" --> Security_Access_Control
Data_Persistence_Database_Integration -- "provides data to" --> SQL_Query_Data_Processing
Data_Persistence_Database_Integration -- "stores data for" --> Business_Logic_Commands
Data_Persistence_Database_Integration -- "is configured by" --> System_Management_Data_Lifecycle
SQL_Query_Data_Processing -- "executes queries on" --> Data_Persistence_Database_Integration
SQL_Query_Data_Processing -- "applies rules from" --> Security_Access_Control
Security_Access_Control -- "enforces permissions on data accessed via" --> Data_Persistence_Database_Integration
Security_Access_Control -- "applies Row-Level Security using" --> SQL_Query_Data_Processing
Security_Access_Control -- "manages" --> Web_API_User_Interface
Asynchronous_Tasks_Reporting -- "executes tasks from" --> Business_Logic_Commands
Asynchronous_Tasks_Reporting -- "retrieves data from" --> Data_Persistence_Database_Integration
Asynchronous_Tasks_Reporting -- "sends notifications via" --> Web_API_User_Interface
System_Management_Data_Lifecycle -- "modifies" --> Data_Persistence_Database_Integration
System_Management_Data_Lifecycle -- "uses" --> Business_Logic_Commands
Tagging_System -- "manages data in" --> Data_Persistence_Database_Integration
click Application_Core_Infrastructure href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/Application Core & Infrastructure.md" "Details"
click Web_API_User_Interface href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/Web API & User Interface.md" "Details"
click Business_Logic_Commands href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/Business Logic & Commands.md" "Details"
click Data_Persistence_Database_Integration href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/Data Persistence & Database Integration.md" "Details"
click SQL_Query_Data_Processing href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/SQL Query & Data Processing.md" "Details"
click Security_Access_Control href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/Security & Access Control.md" "Details"
click Asynchronous_Tasks_Reporting href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/Asynchronous Tasks & Reporting.md" "Details"
click System_Management_Data_Lifecycle href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/System Management & Data Lifecycle.md" "Details"
click Tagging_System href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/superset/Tagging System.md" "Details"
The Superset architecture is designed around a modular and extensible structure, facilitating data exploration, visualization, and dashboarding. The core flow involves application initialization, followed by user interaction through the Web API & User Interface. Business Logic & Commands process these interactions, often relying on the Data Persistence & Database Integration layer for data storage and retrieval. SQL Query & Data Processing handles the complexities of generating and executing SQL queries, including security considerations like Row-Level Security. Security & Access Control is paramount, ensuring proper authentication and authorization across all components. Asynchronous Tasks & Reporting manages background operations and scheduled reports, while System Management & Data Lifecycle provides tools for administrative tasks like migrations and import/export. The Tagging System allows for better organization and discovery of assets.
Manages the fundamental setup of the Superset application, including configuration, logging, and core services. It also provides common utility functions, temporary data caching, and distributed locking mechanisms essential for application stability and performance.
Related Classes/Methods:
superset.app.create_app(41:76)superset.initialization.SupersetAppInitializer:init_app(full file reference)superset.initialization.SupersetAppInitializer:init_app_in_ctx(full file reference)superset.initialization.SupersetAppInitializer:configure_fab(full file reference)superset.initialization.SupersetAppInitializer:configure_logging(full file reference)superset.initialization.SupersetAppInitializer:configure_feature_flags(full file reference)superset.utils.json.dumps(187:228)superset.utils.core.get_user_id(1265:1280)superset.utils.date_parser.get_since_until(314:529)superset.utils.hashing.md5_sha_from_dict(27:36)superset.utils.decorators.transaction(239:279)superset.utils.csv.df_to_escaped_csv(67:81)superset.utils.screenshots.BaseScreenshot:get_screenshot(171:176)superset.utils.rls.apply_rls(32:66)superset.utils.database.get_example_database(66:67)superset.commands.explore.form_data.create.CreateFormDataCommand:run(40:68)superset.commands.temporary_cache.get.GetTemporaryCacheCommand:run(34:39)superset.temporary_cache.api.TemporaryCacheRestApi:post(70:87)superset.utils.cache_manager.CacheManager:init_app(89:101)superset.distributed_lock.KeyValueDistributedLock(full file reference)superset.commands.distributed_lock.create.CreateDistributedLock:run(56:64)superset.commands.distributed_lock.delete.DeleteDistributedLock:run(48:49)superset.distributed_lock.utils:get_key(44:45)
Provides the external interface for Superset, handling incoming HTTP requests, rendering the user interface, and exposing RESTful APIs for various functionalities. It serves as the primary interaction point for users.
Related Classes/Methods:
superset.views.base.BaseSupersetView:render_app_template(208:222)superset.views.base.json_success(131:132)superset.views.error_handling:handle_api_exception(90:129)superset.charts.api.ChartRestApi:post(299:353)superset.dashboards.api.DashboardRestApi:get(338:376)superset.databases.api.DatabaseRestApi:put(493:565)superset.sqllab.api.SqlLabRestApi:execute_sql_query(359:421)superset.explore.api.ExploreRestApi:get(55:135)
Implements the core business rules and operations for managing Superset entities like charts, dashboards, and databases. It uses a command pattern to encapsulate actions and orchestrate interactions with data access and other services.
Related Classes/Methods:
superset.commands.base.CreateMixin:populate_owners(48:58)superset.commands.chart.create.CreateChartCommand:run(47:51)superset.commands.dashboard.update.UpdateDashboardCommand:run(57:72)superset.commands.database.delete.DeleteDatabaseCommand:run(44:47)superset.commands.sql_lab.execute.ExecuteSqlCommand:run(95:125)superset.commands.report.create.CreateReportScheduleCommand:run(53:55)superset.commands.security.create.CreateRLSRuleCommand:run(40:42)
Handles all interactions with various database systems, including defining ORM models, providing a data access object (DAO) layer for CRUD operations, and managing database-specific configurations and behaviors (e.g., SQL dialects, connection parameters).
Related Classes/Methods:
superset.daos.base.BaseDAO.find_by_id(53:72)superset.daos.chart.ChartDAO:add_favorite(54:64)superset.daos.dashboard.DashboardDAO:copy_dashboard(284:321)superset.daos.database.DatabaseDAO:update(41:62)superset.daos.dataset.DatasetDAO:update(177:203)superset.daos.query.QueryDAO:stop_query(60:79)superset.daos.key_value.KeyValueDAO:create_entry(84:111)superset.models.core.Database:get_sqla_engine(409:464)superset.models.dashboard.Dashboard:export_dashboards(360:428)superset.models.slice.Slice:get_query_context(289:298)superset.models.sql_lab.Query:to_dict(164:194)superset.models.helpers.ImportExportMixin:import_from_dict(252:368)superset.db_engine_specs.base.BaseEngineSpec:convert_dttm(1195:1206)superset.db_engine_specs.base.BaseEngineSpec:fetch_data(971:1008)superset.db_engine_specs.base.BaseEngineSpec:get_table_names(1366:1391)superset.db_engine_specs.presto.PrestoEngineSpec:get_columns(full file reference)superset.db_engine_specs.bigquery.BigQueryEngineSpec:estimate_query_cost(502:538)superset.db_engine_specs.snowflake.SnowflakeEngineSpec:validate_parameters(327:351)
Encompasses the entire lifecycle of SQL queries within Superset, from parsing and sanitization to execution, result retrieval, and post-processing for visualization. It also includes the application of Row-Level Security (RLS) and handling of SQL Lab functionalities.
Related Classes/Methods:
superset.sql_lab.get_sql_results(171:198)superset.sql_lab.execute_sql_statements(363:617)superset.sqllab.sqllab_execution_context.SqlJsonExecutionContext:create_query(149:183)superset.sqllab.sql_json_executer.SynchronousSqlJsonExecutor:execute(87:116)superset.views.sqllab.SqllabView:root(43:49)superset.views.sql_lab.views.TabStateView:post(57:85)superset.sql.parse.SQLScript.format(1194:1201)superset.sql.parse.extract_tables_from_jinja_sql(1357:1421)superset.sql.parse.sanitize_clause(1424:1431)superset.sql.parse.RLSTransformer:get_predicate(146:165)superset.sql.parse.SQLStatement:optimize(678:688)superset.common.query_object.QueryObject:__init__(112:166)superset.common.query_object.QueryObject:exec_post_processing(443:470)superset.common.query_context_processor.QueryContextProcessor:get_df_payload(130:231)superset.common.query_context_factory.QueryContextFactory:create(47:105)superset.charts.client_processing:apply_client_processing(312:387)
Manages user authentication, role-based access control (RBAC), and fine-grained permissions across all Superset resources. It also handles guest access and permalink generation for secure content sharing.
Related Classes/Methods:
superset.security.manager.SupersetSecurityManager:can_access_database(510:522)superset.security.manager.SupersetSecurityManager:raise_for_access(2200:2456)superset.security.manager.SupersetSecurityManager:sync_role_definitions(1099:1124)superset.security.manager.SupersetSecurityManager:is_guest_user(2695:2707)superset.security.analytics_db_safety:check_sqlalchemy_uri(37:58)superset.row_level_security.api.RLSRestApi:post(158:224)superset.security.manager.SupersetSecurityManager:create_guest_access_token(2617:2640)superset.security.manager.SupersetSecurityManager:get_guest_user_from_request(2642:2673)superset.commands.explore.permalink.create.CreateExplorePermalinkCommand:run(56:74)superset.commands.dashboard.permalink.get.GetDashboardPermalinkCommand:run(42:60)superset.key_value.shared_entries:get_permalink_salt(42:48)
Manages background jobs, scheduled reports, and alerts. It leverages a task queue for offloading long-running processes and handles the generation and delivery of notifications via various channels (e.g., email, Slack).
Related Classes/Methods:
superset.tasks.scheduler:scheduler(44:78)superset.tasks.thumbnails.cache_chart_thumbnail(38:71)superset.tasks.async_queries:load_chart_data_into_cache(83:113)superset.async_events.async_query_manager.AsyncQueryManager:submit_chart_data_job(237:257)superset.tasks.scheduler:execute(82:113)superset.reports.notifications.email.EmailNotification:send(231:262)superset.reports.notifications.slack.SlackNotification:send(88:135)superset.reports.notifications.slackv2.SlackV2Notification:send(82:132)superset.commands.report.execute.BaseReportState:send(618:625)superset.commands.report.alert.AlertCommand:run(62:90)
Provides tools and functionalities for administrative tasks, including database schema migrations, command-line utilities for data loading and management, and a framework for importing and exporting Superset assets.
Related Classes/Methods:
superset.migrations.versions.2022-03_04_09_59_6766938c6065_add_key_value_store:upgrade(full file reference)superset.migrations.shared.utils.create_table(235:254)superset.migrations.shared.constraints.redefine(39:73)superset.migrations.shared.security_converge.add_pvms(163:179)superset.migrations.shared.migrate_viz.base.MigrateViz.upgrade(201:207)superset.cli.examples:load_examples(108:115)superset.cli.importexport:export_dashboards(70:93)superset.cli.test_db:test_db(141:173)superset.cli.update:sync_tags(59:69)superset.cli.viz_migrations:upgrade(109:115)superset.commands.export.models.ExportModelsCommand:run(58:73)superset.commands.importers.v1.ImportModelsCommand:run(full file reference)superset.commands.importers.v1.utils.get_contents_from_bundle(216:222)superset.importexport.api.ImportExportRestApi:export(52:92)superset.importexport.api.ImportExportRestApi:import_(102:215)
Enables users to organize and discover Superset content (charts, dashboards, datasets) through a flexible tagging mechanism, supporting creation, assignment, and retrieval of tags.
Related Classes/Methods: