Вот воспроизводимый пример:
Код: Выделить всё
# Create a record
df_a = pl.DataFrame(
{
'type': ['a'],
'date': ['2024-08-15'],
'value': [68]
}
)
# Create a record
df_b = pl.DataFrame(
{
'type': ['a'],
'date': ['2024-08-15'],
'value': [39]
}
)
# Write the first record partitioned by type and date
df_a.write_parquet('./data/example.parquet', partition_by=['type', 'date'])
# Write the second record partitioned by type and date where the type and date are the same as the first record
df_b.write_parquet('./data/example.parquet', partition_by=['type', 'date'])
# Read the written data
check = pl.read_parquet('./data/example.parquet/')
Подробнее здесь: https://stackoverflow.com/questions/788 ... sting-file