Skip to content

Commit ef6e548

Browse files
author
Jesse
authored
[RT] Misc Fixes (#118)
- Don't halt fixing qrds refs if a bad ref is found - Fix: the check for an app.redash.io ORIGIN was incorrect
1 parent 1cc98c0 commit ef6e548

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redash_toolbelt"
3-
version = "0.1.8"
3+
version = "0.1.9"
44
description = "Redash API client and tools to manage your instance."
55
authors = ["Redash Maintainers"]
66
license = "BSD-2-Clause"
@@ -15,7 +15,8 @@ packages = [
1515
[tool.poetry.dependencies]
1616
python = "^3.6"
1717
requests = "^2.22.0"
18-
click = "^7.0"
18+
click = "^8.0.3"
19+
1920

2021
[tool.poetry.dev-dependencies]
2122

redash_toolbelt/examples/migrate.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,10 @@ def fix_qrds_refs(orig_client, dest_client):
476476
query_text = query["query"]
477477

478478
for origin_id in origin_query_ids:
479-
480-
_origin_id = int(origin_id)
479+
try:
480+
_origin_id = int(origin_id)
481+
except:
482+
continue
481483

482484
dest_id = meta["queries"].get(_origin_id)
483485

@@ -935,14 +937,15 @@ def import_favorites(orig_client, dest_client):
935937

936938
def fix_csv_queries(orig_client, dest_client):
937939

938-
if "app.redash.io" not in DESTINATION:
940+
if "app.redash.io" not in ORIGIN:
939941
confirm = input(
940942
"It doesn't look like you moved from Hosted Redash. Are you certain you want to run this script? [Type 'yes' to proceed]"
941943
)
942-
943-
if confirm != "yes":
944-
print("Operation aborted")
945-
return
944+
if confirm != "yes":
945+
print("Operation aborted")
946+
return
947+
else:
948+
pass
946949

947950
# Fetch csvurl data sources
948951
data_sources = dest_client.get_data_sources()
@@ -1285,7 +1288,7 @@ def make_global_meta():
12851288
@click.argument(
12861289
"command",
12871290
)
1288-
@click.version_option(version="1.0")
1291+
@click.version_option(version="0.1.9")
12891292
def main(command):
12901293
"""Redash migration tool. Can be used to migrate objects (users, queries, visualizations, dashboards, alerts, and favorites)
12911294
from one Redash instance to another.

0 commit comments

Comments
 (0)