Skip to content

Commit

Permalink
another clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Dec 4, 2024
1 parent ded0fb9 commit 68f36a6
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions python/cudf/cudf/_lib/parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -471,19 +471,16 @@ def write_parquet(
column_type_length,
output_as_binary
)
user_data = []
tmp_user_data = {}
if partitions_info is not None:
for start_row, num_row in partitions_info:
partitioned_df = table.iloc[start_row: start_row + num_row].copy(
deep=False
)
tmp_user_data["pandas"] = generate_pandas_metadata(partitioned_df, index)
user_data.append(tmp_user_data)
tmp_user_data = {}
user_data = [
{"pandas": generate_pandas_metadata(
table.iloc[start_row:start_row + num_row].copy(deep=False),
index
)}
for start_row, num_row in partitions_info
]
else:
tmp_user_data["pandas"] = generate_pandas_metadata(table, index)
user_data.append(tmp_user_data)
user_data = [{"pandas": generate_pandas_metadata(table, index)}]

if header_version not in ("1.0", "2.0"):
raise ValueError(
Expand Down Expand Up @@ -716,10 +713,7 @@ cdef class ParquetWriter:
index = (
False if isinstance(table._index, cudf.RangeIndex) else self.index
)
pandas_metadata = generate_pandas_metadata(table, index)
tmp_user_data={}
tmp_user_data["pandas"] = pandas_metadata
user_data = [tmp_user_data]*num_partitions
user_data = [{"pandas" : generate_pandas_metadata(table, index)}]*num_partitions
cdef compression_type comp_type = _get_comp_type(self.compression)
cdef statistics_freq stat_freq = _get_stat_freq(self.statistics)
cdef dictionary_policy dict_policy = (
Expand Down

0 comments on commit 68f36a6

Please sign in to comment.