chore: Embrace the walrus operator (#24127)

This commit is contained in:
John Bodley
2023-05-19 00:37:13 -07:00
committed by GitHub
parent 6b5459121f
commit d583ca9ef5
54 changed files with 100 additions and 185 deletions

View File

@@ -40,8 +40,7 @@ class MigrateAreaChart(MigrateViz):
if self.data.get("contribution"):
self.data["contributionMode"] = "row"
stacked = self.data.get("stacked_style")
if stacked:
if stacked := self.data.get("stacked_style"):
stacked_map = {
"expand": "Expand",
"stack": "Stack",
@@ -49,7 +48,6 @@ class MigrateAreaChart(MigrateViz):
self.data["show_extra_controls"] = True
self.data["stack"] = stacked_map.get(stacked)
x_axis_label = self.data.get("x_axis_label")
if x_axis_label:
if x_axis_label := self.data.get("x_axis_label"):
self.data["x_axis_title"] = x_axis_label
self.data["x_axis_title_margin"] = 30