diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 5847730f9f984a..b9ff665f2d6357 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -25,7 +25,7 @@ def __init__(self): try: import pyarrow - from pyarrow import parquet + import pyarrow.parquet except ImportError: raise ImportError("pyarrow is required for parquet support\n\n" "you can install via conda\n" @@ -33,15 +33,14 @@ def __init__(self): "\nor via pip\n" "pip install pyarrow\n") self.api = pyarrow - self.parquet = parquet def write(self, df, path, compression=None, **kwargs): table = self.api.Table.from_pandas(df) - self.parquet.write_table( + self.api.parquet.write_table( table, path, compression=compression, **kwargs) def read(self, path): - return self.parquet.read_table(path).to_pandas() + return self.api.parquet.read_table(path).to_pandas() class FastParquetImpl(object):