Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
chelsea-lin committed Oct 31, 2024
1 parent c410354 commit 73e3f8e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions db_dtypes/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ def __init__(self, values) -> None:
elif isinstance(values, pa.ChunkedArray):
pa_data = values
else:
raise NotImplementedError(f"Unsupported type '{type(values)}' for JSONArray")

raise NotImplementedError(
f"Unsupported type '{type(values)}' for JSONArray"
)

# Ensures compatibility with pandas version 1.5.3
if hasattr(self, '_data'):
if hasattr(self, "_data"):
self._data = pa_data
elif hasattr(self, '_pa_array'):
elif hasattr(self, "_pa_array"):
self._pa_array = pa_data
else:
raise NotImplementedError(f"Unsupported pandas version: {pd.__version__}")
Expand Down Expand Up @@ -160,9 +162,9 @@ def dtype(self) -> JSONDtype:
def pa_data(self):
"""An instance of stored pa data"""
# Ensures compatibility with pandas version 1.5.3
if hasattr(self, '_data'):
if hasattr(self, "_data"):
return self._data
elif hasattr(self, '_pa_array'):
elif hasattr(self, "_pa_array"):
return self._pa_array
else:
raise NotImplementedError(f"Unsupported pandas version: {pd.__version__}")
Expand Down

0 comments on commit 73e3f8e

Please sign in to comment.