yigal-rozenberg commented on code in PR #1614: URL: https://github.com/apache/iceberg-python/pull/1614#discussion_r1949880005
########## pyiceberg/table/__init__.py: ########## @@ -1624,6 +1638,19 @@ def to_ray(self) -> ray.data.dataset.Dataset: return ray.data.from_arrow(self.to_arrow()) + def to_polars(self) -> pl.DataFrame: + """Read a Polars DataFrame from this Iceberg table. + + Returns: + pl.DataFrame: Materialized Polars Dataframe from the Iceberg table + """ + import polars as pl + + result = pl.from_arrow(self.to_arrow()) + if isinstance(result, pl.Series): + result = result.to_frame() Review Comment: IMHO having a polymorphic API is connfusing and if the promice of a data scan is to return a data frame we shuld return a data frame. If there is a need for Series a polars data frame can return series: [text](https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://docs.pola.rs/py-polars/html/reference/dataframe/api/polars.DataFrame.to_series.html&ved=2ahUKEwiTpemX_7mLAxUYMVkFHRqXHDcQFnoECAwQAQ&usg=AOvVaw1roGPPVi1cYLFqxFwbX-i4) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org