Skip to content

Commit

Permalink
Update superset/sql_lab.py
Browse files Browse the repository at this point in the history
walrus operator used as suggested

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
  • Loading branch information
anamitraadhikari and villebro authored Oct 9, 2024
1 parent 76bebbc commit 07535c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 610 in superset/sql_lab.py

View check run for this annotation

Codecov / codecov/patch

superset/sql_lab.py#L609-L610

Added lines #L609 - L610 were not covered by tests

if serialized_payload_size > max_bytes:
Expand Down

0 comments on commit 07535c8

Please sign in to comment.