From 3e8a32404c0244922558ab424ceb145045695d1f Mon Sep 17 00:00:00 2001 From: Ceyhun Kerti Date: Wed, 25 Sep 2024 00:42:54 +0300 Subject: [PATCH] lazy from with http --- lib/explorer/polars_backend/lazy_frame.ex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/explorer/polars_backend/lazy_frame.ex b/lib/explorer/polars_backend/lazy_frame.ex index 6b3d992a4..d2beea125 100644 --- a/lib/explorer/polars_backend/lazy_frame.ex +++ b/lib/explorer/polars_backend/lazy_frame.ex @@ -10,6 +10,7 @@ defmodule Explorer.PolarsBackend.LazyFrame do alias FSS.Local alias FSS.S3 + alias FSS.HTTP import Explorer.PolarsBackend.Expression, only: [to_expr: 1, alias_expr: 2] @@ -209,6 +210,14 @@ defmodule Explorer.PolarsBackend.LazyFrame do end end + @impl true + def from_parquet(%HTTP.Entry{url: url}, max_rows, columns, _rechunk) do + case Native.lf_from_parquet(url, max_rows, columns) do + {:ok, polars_ldf} -> Shared.create_dataframe(polars_ldf) + {:error, error} -> {:error, RuntimeError.exception(error)} + end + end + @impl true def from_parquet(%Local.Entry{} = entry, max_rows, columns, _rechunk) do case Native.lf_from_parquet(entry.path, max_rows, columns) do