Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions python/pyarrow/tests/parquet/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def alltypes_sample(size=10000, seed=0, categorical=False):
# TODO(wesm): Test other timestamp resolutions now that arrow supports
# them
'datetime': np.arange("2016-01-01T00:00:00.001", size,
dtype='datetime64[ms]'),
'timedelta': np.arange(0, size, dtype="timedelta64[s]"),
dtype='datetime64[ms]').astype('datetime64[ns]'),
'timedelta': np.arange(0, size, dtype="timedelta64[ns]"),
'str': pd.Series([str(x) for x in range(size)]),
'empty_str': [''] * size,
'str_with_nulls': [None] + [str(x) for x in range(size - 2)] + [None],
Expand Down
3 changes: 3 additions & 0 deletions python/pyarrow/tests/parquet/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ def _test_write_to_dataset_with_partitions(base_path,
'nan': [np.nan] * 10,
'date': np.arange('2017-01-01', '2017-01-11',
dtype='datetime64[D]')})
output_df["date"] = output_df["date"].astype('datetime64[ns]')
cols = output_df.columns.tolist()
partition_by = ['group1', 'group2']
output_table = pa.Table.from_pandas(output_df, schema=schema, safe=False,
Expand Down Expand Up @@ -1312,6 +1313,7 @@ def _test_write_to_dataset_no_partitions(base_path,
'num': list(range(10)),
'date': np.arange('2017-01-01', '2017-01-11',
dtype='datetime64[D]')})
output_df["date"] = output_df["date"].astype('datetime64[ns]')
cols = output_df.columns.tolist()
output_table = pa.Table.from_pandas(output_df)

Expand Down Expand Up @@ -1440,6 +1442,7 @@ def test_write_to_dataset_with_partitions_and_custom_filenames(
'nan': [np.nan] * 10,
'date': np.arange('2017-01-01', '2017-01-11',
dtype='datetime64[D]')})
output_df["date"] = output_df["date"].astype('datetime64[ns]')
partition_by = ['group1', 'group2']
output_table = pa.Table.from_pandas(output_df)
path = str(tempdir)
Expand Down
6 changes: 3 additions & 3 deletions python/pyarrow/tests/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _alltypes_example(size=100):
# TODO(wesm): Pandas only support ns resolution, Arrow supports s, ms,
# us, ns
'datetime': np.arange("2016-01-01T00:00:00.001", size,
dtype='datetime64[ms]'),
dtype='datetime64[ms]').astype("datetime64[ns]"),
'str': [str(x) for x in range(size)],
'str_with_nulls': [None] + [str(x) for x in range(size - 2)] + [None],
'empty_str': [''] * size
Expand Down Expand Up @@ -1016,7 +1016,7 @@ def test_timestamps_with_timezone(self):
'2007-07-13T01:23:34.123',
'2006-01-13T12:34:56.432',
'2010-08-13T05:46:57.437'],
dtype='datetime64[ms]')
dtype='datetime64[ms]').astype("datetime64[ns]")
})
df['datetime64'] = df['datetime64'].dt.tz_localize('US/Eastern')
_check_pandas_roundtrip(df)
Expand Down Expand Up @@ -2718,7 +2718,7 @@ def test_strided_data_import(self):
cases.append(boolean_objects)

cases.append(np.arange("2016-01-01T00:00:00.001", N * K,
dtype='datetime64[ms]')
dtype='datetime64[ms]').astype("datetime64[ns]")
.reshape(N, K).copy())

strided_mask = (random_numbers > 0).astype(bool)[:, 0]
Expand Down