Open george-wood opened 6 months ago
Just to note: Using a tilde worked previously; I noticed this error only recently.
Thanks for the report, do you want to make a PR for this? I think this should be solved using path.expand()
but we need to ensure it works correctly when we pass a URL
@etiennebacher Will do. However, before doing so, do you think the cause is on the rust side? Perhaps with the update to 0.39.0? I cannot work out why tilde is only now causing problems.
I agree this can be solved using path.expand()
, but I can't see why expansion should be necessary for write_csv()
where there is no URL checking:
If we end up using path.expand()
, it will need to be implemented across all io functions.
I agree this can be solved using path.expand(), but I can't see why expansion should be necessary for write_csv() where there is no URL checking:
My bad, I thought this error was for read_csv()
only.
I can't see any recent changes in the R or Rust methods that would explain this failure so it's probably from rust-polars:
https://github.com/pola-rs/r-polars/blame/1de4d0dfdf83228f2d4933fc7d8239a565d907fa/R/dataframe__frame.R#L1949 https://github.com/pola-rs/r-polars/blame/1de4d0dfdf83228f2d4933fc7d8239a565d907fa/src/rust/src/rdataframe/mod.rs#L487
Do you remember what was the last package version for which it worked?
They already normalize the file path in python but I can't find a recent commit that changed that, so I suppose passing a path starting with ~
to rust-polars was not really supported before:
Might be worth checking node.js and polars-cli
Do you remember what was the last package version for which it worked?
I believe it worked before the update to rust-polars 0.39.
They already normalize the file path in python
I suppose we should implement the equivalent normalization if ~
is not supported on the rust-polars side. What do you think @etiennebacher and @eitsupi?
I don't know if this is the change was intended upstream or not. I think it could be a bug.
I suppose we should implement the equivalent normalization if ~ is not supported on the rust-polars side
I think so, especially since they handle the ~
in python
I don't know if this is the change was intended upstream or not. I think it could be a bug.
It could be but the file where write_csv()
is defined in python is too big to use git blame in the github interface so I can't check if it changed recently
There seems to be an issue locating files when the filepath/source contains a tilde (e.g.
"~/Desktop/some_file.csv"
). This is a common pattern for macOS users. Any ideas what might be causing this?Created on 2024-05-07 with reprex v2.1.0
I checked the Python implementation and it works as expected:
Created at 2024-05-07 15:27:21 BST by reprexlite v0.5.0