Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3223,6 +3223,13 @@ def combine_first(self, other) -> Series:
"""
from pandas.core.reshape.concat import concat

def replace_none_with_nan(series):
series.fillna(value=np.nan, inplace=True)

"""Apply the function to both Series"""
replace_none_with_nan(self)
replace_none_with_nan(other)

if self.dtype == other.dtype:
if self.index.equals(other.index):
return self.mask(self.isna(), other)
Expand Down
8 changes: 8 additions & 0 deletions pandas/io/parsers/arrow_parser_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ def read(self) -> DataFrame:

dtype_backend = self.kwds["dtype_backend"]

# Handle missing date values by checking for timestamp columns
for i, field in enumerate(table.schema):
if pa.types.is_timestamp(field.type):
column = table.column(i).to_pandas()
column.fillna(pd.NaT, inplace=True)

table = table.set_column(i, field.name, pa.array(column))

# Convert all pa.null() cols -> float64 (non nullable)
# else Int64 (nullable case, see below)
if dtype_backend is lib.no_default:
Expand Down
Loading