Rr 61 polarslazyframe#65
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Polars LazyFrame support to BlobEndpoint.get_dataframe() to enable lazy loading (via scan_*) for certain Azure-hosted datasets.
Changes:
- Introduces a
pl_lazyfast-path that usespl.scan_parquet/pl.scan_csvagainstaz://URIs. - Adds Azure managed-identity credential wiring for Polars cloud reads.
- Removes eager-to-lazy conversion for CSV in the eager path (now handled by the
scan_csvearly return).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the data catalog’s BlobEndpoint.get_dataframe() to support returning a Polars LazyFrame for certain file types by using Polars’ lazy scanning against Azure Blob Storage.
Changes:
- Expands
get_dataframe()return type to includepl.LazyFrame. - Adds a
pl_lazyfast-path that usespl.scan_parquet/pl.scan_csvwith Azure credential plumbing. - Removes the previous
df.lazy()conversion for the eager CSV Polars path (since CSV lazy now uses scanning).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| ) | ||
| self.ledger_entry(action="read") | ||
| return df | ||
| elif file_ext == "csv": |
There was a problem hiding this comment.
I think there is a strong opportunity to generalize all of the polars reading code into something with a variable reading function. Ie you can pass pl.read_csv or pl.scan_csv as an argument to more general function.
There was a problem hiding this comment.
Pull request overview
This PR updates BlobEndpoint.get_dataframe() to support returning a Polars LazyFrame backed by Azure Blob Storage scanning, while also tightening typing via Literal overloads and expanding supported output aliases.
Changes:
- Add
output="pl_lazy"/"lazy"mode that usespl.scan_*againstaz://URIs for parquet/csv/ndjson. - Replace the old
pl_lazy: boolflag with typedoutputvariants and overloads for better return-type inference. - Extend JSON-lines handling to treat
ndjsonandjsonlequivalently.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@damonbayer please re-review. I made all your updates except for generalizing all the polars reading code. Let me know if that's something you need implemented and I can get that added. |
damonbayer
left a comment
There was a problem hiding this comment.
The type hints are not working correctly, but it's not due to anything in this PR. Will open a separate issue. Thanks @ryanraaschCDC!
No description provided.