diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py index ce7b53a96..305a350ae 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py @@ -12,7 +12,6 @@ from pathlib import Path from superset import security_manager -from superset.commands.dataset.refresh import RefreshDatasetCommand from superset.examples.utils import load_configs_from_directory from superset.extensions import db from superset.models.dashboard import Dashboard @@ -20,7 +19,6 @@ from superset.utils.database import get_or_create_db from superset.models.embedded_dashboard import EmbeddedDashboard from pythonpath.localization import get_translation -from flask import g from superset.connectors.sqla.utils import get_columns_description BASE_DIR = "/app/assets/superset" @@ -294,14 +292,8 @@ def update_datasets(): db.session.query(SqlaTable).all() ) for dataset in datasets: - try: - if dataset_is_empty(dataset): - print(f"Dataset {dataset.table_name} is empty") - continue - RefreshDatasetCommand(dataset.id).run() - print(f"Refreshing dataset {dataset.table_name}") - except Exception as e: - print(f"Failed to refresh dataset {dataset.table_name}") + print(f"Refreshing dataset {dataset.table_name}") + dataset.fetch_metadata(commit=True) def dataset_is_empty(dataset): diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml index b362118d9..2ef1233f8 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml @@ -86,6 +86,18 @@ columns: python_date_format: null type: String verbose_name: Video Name +- advanced_data_type: null + column_name: video_position + description: null + expression: null + extra: {} + filterable: true + groupby: true + is_active: true + is_dttm: false + python_date_format: null + type: Decimal(9, 2) + verbose_name: Video Position - advanced_data_type: null column_name: org description: null @@ -98,6 +110,54 @@ columns: python_date_format: null type: String verbose_name: Organization +- advanced_data_type: null + column_name: video_duration + description: null + expression: null + extra: {} + filterable: true + groupby: true + is_active: true + is_dttm: false + python_date_format: null + type: Int64 + verbose_name: Video Duration +- advanced_data_type: null + column_name: graded + description: null + expression: null + extra: {} + filterable: true + groupby: true + is_active: true + is_dttm: false + python_date_format: null + type: Bool + verbose_name: Graded +- advanced_data_type: null + column_name: visualization_bucket + description: null + expression: null + extra: {} + filterable: true + groupby: true + is_active: true + is_dttm: false + python_date_format: null + type: String + verbose_name: Visualization Bucket +- advanced_data_type: null + column_name: video_id + description: null + expression: null + extra: {} + filterable: true + groupby: true + is_active: true + is_dttm: false + python_date_format: null + type: String + verbose_name: Video ID database_uuid: 21174b6c-4d40-4958-8161-d6c3cf5e77b6 default_endpoint: null description: null @@ -130,7 +190,8 @@ metrics: d3format: null description: null expression: COUNT(*) - extra: null + extra: + warning_markdown: '' metric_name: count metric_type: count verbose_name: COUNT(*)