From 23c530d5b48a7dbad5d2c77b5562099ce051a03f Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Wed, 14 Jun 2023 16:59:02 -0700 Subject: [PATCH 1/3] retry tables on import --- superset/datasets/commands/importers/v1/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/datasets/commands/importers/v1/utils.py b/superset/datasets/commands/importers/v1/utils.py index ae47fc411aa36..2e0f15fe09d21 100644 --- a/superset/datasets/commands/importers/v1/utils.py +++ b/superset/datasets/commands/importers/v1/utils.py @@ -167,9 +167,9 @@ def import_dataset( except Exception: # pylint: disable=broad-except # MySQL doesn't play nice with GSheets table names logger.warning( - "Couldn't check if table %s exists, assuming it does", dataset.table_name + "Couldn't check if table %s exists, assuming it doesn't", dataset.table_name ) - table_exists = True + table_exists = False if data_uri and (not table_exists or force_data): load_data(data_uri, dataset, dataset.database, session) From 6902e23ac3fa07e8e7de786b6f245f24bdd3c227 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Mon, 1 May 2023 14:18:58 -0600 Subject: [PATCH 2/3] fix docker build --- .github/workflows/docker-ephemeral-env.yml | 4 ++++ .github/workflows/docker.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/docker-ephemeral-env.yml b/.github/workflows/docker-ephemeral-env.yml index 5159a8b77998b..bc877ae9ae737 100644 --- a/.github/workflows/docker-ephemeral-env.yml +++ b/.github/workflows/docker-ephemeral-env.yml @@ -22,6 +22,10 @@ jobs: secrets.AWS_SECRET_ACCESS_KEY != '' && secrets.AWS_SECRET_ACCESS_KEY != '') || '' }}" ]; then echo "has-secrets=1" >> "$GITHUB_OUTPUT" + echo "has secrets!" + else + echo "has-secrets=0" >> "$GITHUB_OUTPUT" + echo "no secrets!" fi docker_ephemeral_env: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f9c62501f32e9..7c5b50baf430f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,6 +20,10 @@ jobs: run: | if [ -n "${{ (secrets.DOCKERHUB_USER != '' && secrets.DOCKERHUB_TOKEN != '') || '' }}" ]; then echo "has-secrets=1" >> "$GITHUB_OUTPUT" + echo "has secrets!" + else + echo "has-secrets=0" >> "$GITHUB_OUTPUT" + echo "no secrets!" fi docker-build: From 8205609a397a0877e5b98baca1aed4d4eac11aed Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Thu, 15 Jun 2023 15:05:43 -0700 Subject: [PATCH 3/3] pass force to reload data --- RELEASING/from_tarball_entrypoint.sh | 2 +- docker/docker-init.sh | 2 +- superset/datasets/commands/importers/v1/utils.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RELEASING/from_tarball_entrypoint.sh b/RELEASING/from_tarball_entrypoint.sh index 9fe0516abb90b..27b247eb72fe8 100755 --- a/RELEASING/from_tarball_entrypoint.sh +++ b/RELEASING/from_tarball_entrypoint.sh @@ -36,7 +36,7 @@ superset db upgrade superset init # Loading examples -superset load-examples +superset load-examples --force FLASK_ENV=development FLASK_APP="superset.app:create_app()" \ flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0 diff --git a/docker/docker-init.sh b/docker/docker-init.sh index c98f49881ada7..b54f999cb2a85 100755 --- a/docker/docker-init.sh +++ b/docker/docker-init.sh @@ -72,7 +72,7 @@ if [ "$SUPERSET_LOAD_EXAMPLES" = "yes" ]; then superset load_test_users superset load_examples --load-test-data else - superset load_examples + superset load_examples --force fi echo_step "4" "Complete" "Loading examples" fi diff --git a/superset/datasets/commands/importers/v1/utils.py b/superset/datasets/commands/importers/v1/utils.py index 2e0f15fe09d21..ae47fc411aa36 100644 --- a/superset/datasets/commands/importers/v1/utils.py +++ b/superset/datasets/commands/importers/v1/utils.py @@ -167,9 +167,9 @@ def import_dataset( except Exception: # pylint: disable=broad-except # MySQL doesn't play nice with GSheets table names logger.warning( - "Couldn't check if table %s exists, assuming it doesn't", dataset.table_name + "Couldn't check if table %s exists, assuming it does", dataset.table_name ) - table_exists = False + table_exists = True if data_uri and (not table_exists or force_data): load_data(data_uri, dataset, dataset.database, session)