Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File materialization functions #61

Open
mortenpi opened this issue Feb 13, 2023 · 0 comments
Open

File materialization functions #61

mortenpi opened this issue Feb 13, 2023 · 0 comments

Comments

@mortenpi
Copy link
Member

Conceptually, our datasets don't necessarily have an underlying file object on disk (e.g. the datasets fully stored in TOML files). As such, we only offer access to their contents via an ::IO object. However, sometimes you need to access it a File as a file system file (e.g. #60). We could export two file "materialization" functions:

  • save(::File/FileTree, path::String): takes the File or FileTree object and writes it to path. The purpose of these functions is to allow the extraction of datasets from data repositories.
  • materialize(::File): returns a file path; the purpose is to give (read) access to the dataset as a file system file. For datasets that already have a file somewhere on disk anyway, return that. For datasets that don't (e.g. TOML file, remote datasets), it would automatically create a temporary file (lifetime is the Julia session; would fix Better interoperation with Parquet files #60).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant