Skip to content

Commit

Permalink
fix mypy return
Browse files Browse the repository at this point in the history
  • Loading branch information
gene-db committed Apr 8, 2024
1 parent 807d574 commit 62277ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/pyspark/sql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,9 +1348,10 @@ class VariantType(AtomicType):
def needConversion(self) -> bool:
return True

def fromInternal(self, obj: Dict) -> "VariantVal":
if obj is not None and all(key in obj for key in ["value", "metadata"]):
return VariantVal(obj["value"], obj["metadata"])
def fromInternal(self, obj: Dict) -> Optional["VariantVal"]:
if obj is None or all(key in obj for key in ["value", "metadata"]):
return None
return VariantVal(obj["value"], obj["metadata"])


class UserDefinedType(DataType):
Expand Down

0 comments on commit 62277ac

Please sign in to comment.