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

Implement fspath for ln.Artifact #2350

Open
chaichontat opened this issue Jan 13, 2025 · 2 comments
Open

Implement fspath for ln.Artifact #2350

chaichontat opened this issue Jan 13, 2025 · 2 comments

Comments

@chaichontat
Copy link
Contributor

chaichontat commented Jan 13, 2025

Can ln.Artifact implement the fspath() protocol? The use case is when I want to load a file as if it's from a local path without any magic.

For example, pd.read_csv(ln.Artifact("mypath.csv")).

In this case, ln.Artifact should automatically call .cache().

@Koncopd
Copy link
Member

Koncopd commented Jan 13, 2025

pd.read_csv(ln.Artifact("mypath.csv"))
This is not a correct way to load from an artifact, it is better to save it first.

And i don't really see any point in having pd.read_csv(artifact), if we have artifact.load() already.

@chaichontat
Copy link
Contributor Author

chaichontat commented Jan 13, 2025

pd.read_csv(ln.Artifact("mypath.csv"))
This is not a correct way to load from an artifact, it is better to save it first.

Doesn't this get an artifact from the db?

Also the correct way should be the path of least resistance.

The file is just an example. I use polars, not pandas, and hence I need pl.read_csv instead. This goes for other people who may want other means of opening a csv file, including as raw text.

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

2 participants