write delta table regression with 0.6
Environment
Delta-rs version: 0.6.0
Binding: Python
Environment:
- Cloud provider:
- OS: Windows 10
- Other:
Bug
this code used to work fine
`from deltalake import write_deltalake
import duckdb
con = duckdb.connect()
result =con.execute('''
with xx as (select *,extract ( year from l_shipdate) as year from 'C:/Users/TPC-H-SF10/Parquet/lineitem.parquet')
select * from xx ;
''').fetch_record_batch()
write_deltalake("C:/delta2",
result,
partition_by=['year'])`
Now it generate errors, it does not works at all if I don't create the folder manually, and when I created manually it generate this error
File "C:\Users\mimoune.djouallah\AppData\Local\Programs\Python\Python310\lib\site-packages\deltalake\writer.py", line 201, in visitor path, partition_values = get_partitions_from_path(table_uri, written_file.path) File "C:\Users\mimoune.djouallah\AppData\Local\Programs\Python\Python310\lib\site-packages\deltalake\writer.py", line 301, in get_partitions_from_path path = path.split(base_path, maxsplit=1)[1] IndexError: list index out of range
@wjones127 any update on this, this is a very big regression ?
I'll look at this when I get back from vacation. This looks like it is specific to Windows paths, which we aren't currently testing. So we'll want to add Windows tests.
Okay, so this wasn't Windows-specific at all. Turns out we had broken writing tables to directories that didn't exist yet, which we weren't testing. I've added a test and fix for that in #811.
@roeap actually fixed the second issue as a part of #799, so are good there.
Thanks for reporting this.
@wjones127 thanks a lot, please just keep releasing new binary revisions :)