Skip to content

Commit 9662db7

Browse files
committed
only need .api
1 parent a0e4076 commit 9662db7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pandas/io/parquet.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,22 @@ def __init__(self):
2525

2626
try:
2727
import pyarrow
28-
from pyarrow import parquet
28+
import pyarrow.parquet
2929
except ImportError:
3030
raise ImportError("pyarrow is required for parquet support\n\n"
3131
"you can install via conda\n"
3232
"conda install pyarrow -c conda-forge\n"
3333
"\nor via pip\n"
3434
"pip install pyarrow\n")
3535
self.api = pyarrow
36-
self.parquet = parquet
3736

3837
def write(self, df, path, compression=None, **kwargs):
3938
table = self.api.Table.from_pandas(df)
40-
self.parquet.write_table(
39+
self.api.parquet.write_table(
4140
table, path, compression=compression, **kwargs)
4241

4342
def read(self, path):
44-
return self.parquet.read_table(path).to_pandas()
43+
return self.api.parquet.read_table(path).to_pandas()
4544

4645

4746
class FastParquetImpl(object):

0 commit comments

Comments
 (0)