From 2f1014bff2a85274d6cc8e3c67d073ce1dfacfbe Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Fri, 28 Aug 2020 12:26:17 +0000 Subject: [PATCH 1/2] fix: Fix deprecation warnings due to invalid escape sequences. --- superset/config.py | 2 +- superset/models/helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/config.py b/superset/config.py index 1cce91e91a314..9d1f6e6827581 100644 --- a/superset/config.py +++ b/superset/config.py @@ -147,7 +147,7 @@ def _try_json_readsha( # pylint: disable=unused-argument # Your App secret key SECRET_KEY = ( - "\2\1thisismyscretkey\1\2\e\y\y\h" # pylint: disable=anomalous-backslash-in-string + "\2\1thisismyscretkey\1\2\\e\\y\\y\\h" ) # The SQLAlchemy connection string. diff --git a/superset/models/helpers.py b/superset/models/helpers.py index d903d271a1499..93db9bf91aabe 100644 --- a/superset/models/helpers.py +++ b/superset/models/helpers.py @@ -46,7 +46,7 @@ def json_to_dict(json_str: str) -> Dict[Any, Any]: if json_str: val = re.sub(",[ \t\r\n]+}", "}", json_str) val = re.sub( - ",[ \t\r\n]+\]", "]", val # pylint: disable=anomalous-backslash-in-string + ",[ \t\r\n]+\\]", "]", val ) return json.loads(val) From 1415beb242e0cdb3c24115487cd5c6ebced87558 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Fri, 28 Aug 2020 12:47:21 +0000 Subject: [PATCH 2/2] fix: Fix black related errors. --- superset/config.py | 4 +--- superset/models/helpers.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/superset/config.py b/superset/config.py index 9d1f6e6827581..acabb0e7b6e7c 100644 --- a/superset/config.py +++ b/superset/config.py @@ -146,9 +146,7 @@ def _try_json_readsha( # pylint: disable=unused-argument # --------------------------------------------------------- # Your App secret key -SECRET_KEY = ( - "\2\1thisismyscretkey\1\2\\e\\y\\y\\h" -) +SECRET_KEY = "\2\1thisismyscretkey\1\2\\e\\y\\y\\h" # The SQLAlchemy connection string. SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "superset.db") diff --git a/superset/models/helpers.py b/superset/models/helpers.py index 93db9bf91aabe..3fdcd9702cfb2 100644 --- a/superset/models/helpers.py +++ b/superset/models/helpers.py @@ -45,9 +45,7 @@ def json_to_dict(json_str: str) -> Dict[Any, Any]: if json_str: val = re.sub(",[ \t\r\n]+}", "}", json_str) - val = re.sub( - ",[ \t\r\n]+\\]", "]", val - ) + val = re.sub(",[ \t\r\n]+\\]", "]", val) return json.loads(val) return {}