Skip to content

Commit

Permalink
Fix pyarrow issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alifbe committed Nov 14, 2023
1 parent f5b197c commit 193427f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion ecl2df/wellcompletiondata.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _df2pyarrow(dframe: pd.DataFrame) -> pyarrow.Table:
else:
field_metadata = {}
if colname == "DATE":
dtype = pyarrow.timestamp("ms")
dtype = pyarrow.timestamp("ns")
elif pd.api.types.is_integer_dtype(dframe.dtypes[colname]):
dtype = pyarrow.int32()
elif pd.api.types.is_string_dtype(dframe.dtypes[colname]):
Expand Down
7 changes: 0 additions & 7 deletions tests/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,13 +1118,6 @@ def test_df2pyarrow_500years():
dframe.index.name = "BOGUS"
pyat = _df2pyarrow(dframe)

# pylint: disable=c-extension-no-member
with pytest.raises(pyarrow.lib.ArrowInvalid):
# We cannot convert this back to Pandas, since it will bail on failing
# to use nanosecond timestamps in the dataframe object for these dates.
# This is maybe a PyArrow bug/limitation that we must be aware of.
pyat.to_pandas()

assert (
np.array(pyat.column(0))
== [
Expand Down

0 comments on commit 193427f

Please sign in to comment.