We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5dd4cae commit 7c7a7a9Copy full SHA for 7c7a7a9
pandas/io/parquet.py
@@ -123,10 +123,16 @@ def write(self, df, path, compression='snappy',
123
table, path, compression=compression, **kwargs)
124
125
else:
126
- table = self.api.Table.from_pandas(df, **from_pandas_kwargs)
127
- self.api.parquet.write_table(
128
- table, path, compression=compression,
129
- coerce_timestamps=coerce_timestamps, **kwargs)
+ if 'partition_cols' in kwargs and len(kwargs['partition_cols']) > 0:
+ table = self.api.Table.from_pandas(df)
+ self.api.parquet.write_to_dataset(
+ table, path, compression=compression,
130
+ coerce_timestamps=coerce_timestamps, **kwargs)
131
+ else:
132
133
+ self.api.parquet.write_table(
134
135
136
137
def read(self, path, columns=None, **kwargs):
138
path, _, _, should_close = get_filepath_or_buffer(path)
0 commit comments