Skip to content

Commit ceee19b

Browse files
Ensure HDFStore read gives column-major data with CoW (#55743)
1 parent 327d559 commit ceee19b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/io/pytables.py

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from pandas._config import (
3131
config,
3232
get_option,
33+
using_copy_on_write,
3334
using_pyarrow_string_dtype,
3435
)
3536

@@ -3297,6 +3298,10 @@ def read(
32973298

32983299
if len(dfs) > 0:
32993300
out = concat(dfs, axis=1, copy=True)
3301+
if using_copy_on_write():
3302+
# with CoW, concat ignores the copy keyword. Here, we still want
3303+
# to copy to enforce optimized column-major layout
3304+
out = out.copy()
33003305
out = out.reindex(columns=items, copy=False)
33013306
return out
33023307

0 commit comments

Comments
 (0)