Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
gene-db committed Apr 4, 2024
1 parent 25c6ab9 commit aad5d3d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions python/pyspark/sql/connect/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,11 @@ def convert_variant(value: Any) -> Any:
if not nullable:
raise PySparkValueError(f"input for {dataType} must not be None")
return None
elif (isinstance(value, dict) and
all(key in value for key in ["value", "metadata"]) and
all(isinstance(value[key], bytes) for key in ["value", "metadata"])):
elif (
isinstance(value, dict)
and all(key in value for key in ["value", "metadata"])
and all(isinstance(value[key], bytes) for key in ["value", "metadata"])
):
return VariantVal(value["value"], value["metadata"])
else:
raise PySparkValueError(error_class="MALFORMED_VARIANT")
Expand Down Expand Up @@ -515,9 +517,11 @@ def convert_udt(value: Any) -> Any:
def convert_variant(value: Any) -> Any:
if value is None:
return None
elif (isinstance(value, dict) and
all(key in value for key in ["value", "metadata"]) and
all(isinstance(value[key], bytes) for key in ["value", "metadata"])):
elif (
isinstance(value, dict)
and all(key in value for key in ["value", "metadata"])
and all(isinstance(value[key], bytes) for key in ["value", "metadata"])
):
return VariantVal(value["value"], value["metadata"])
else:
raise PySparkValueError(error_class="MALFORMED_VARIANT")
Expand Down

0 comments on commit aad5d3d

Please sign in to comment.