From 07535c8aca00e087207d873d86f88c0cdb22bff5 Mon Sep 17 00:00:00 2001 From: anamitraadhikari <97945303+anamitraadhikari@users.noreply.github.com> Date: Tue, 8 Oct 2024 17:20:24 -0700 Subject: [PATCH] Update superset/sql_lab.py walrus operator used as suggested Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> --- superset/sql_lab.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/superset/sql_lab.py b/superset/sql_lab.py index 0a4902e51344..87668026ae74 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -605,9 +605,8 @@ def execute_sql_statements( ) # Check the size of the serialized payload - if config.get("SQL_LAB_PAYLOAD_MAX_MB"): + if sql_lab_payload_max_mb := config.get("SQL_LAB_PAYLOAD_MAX_MB"): serialized_payload_size = sys.getsizeof(serialized_payload) - sql_lab_payload_max_mb = config["SQL_LAB_PAYLOAD_MAX_MB"] max_bytes = sql_lab_payload_max_mb * 1024 * 1024 if serialized_payload_size > max_bytes: