mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
chore: Embrace the walrus operator (#24127)
This commit is contained in:
@@ -62,8 +62,7 @@ def get_sqla_type(native_type: str) -> VisitableType:
|
||||
if native_type.upper() in type_map:
|
||||
return type_map[native_type.upper()]
|
||||
|
||||
match = VARCHAR.match(native_type)
|
||||
if match:
|
||||
if match := VARCHAR.match(native_type):
|
||||
size = int(match.group(1))
|
||||
return String(size)
|
||||
|
||||
|
||||
@@ -114,13 +114,11 @@ class UpdateDatasetCommand(UpdateMixin, BaseCommand):
|
||||
exceptions.append(DatasetEndpointUnsafeValidationError())
|
||||
|
||||
# Validate columns
|
||||
columns = self._properties.get("columns")
|
||||
if columns:
|
||||
if columns := self._properties.get("columns"):
|
||||
self._validate_columns(columns, exceptions)
|
||||
|
||||
# Validate metrics
|
||||
metrics = self._properties.get("metrics")
|
||||
if metrics:
|
||||
if metrics := self._properties.get("metrics"):
|
||||
self._validate_metrics(metrics, exceptions)
|
||||
|
||||
if exceptions:
|
||||
|
||||
Reference in New Issue
Block a user