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

Issue with lazy frames reading from s3 in long running process #19933

Open
2 tasks done
kfreisen opened this issue Nov 22, 2024 · 1 comment
Open
2 tasks done

Issue with lazy frames reading from s3 in long running process #19933

kfreisen opened this issue Nov 22, 2024 · 1 comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@kfreisen
Copy link

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

df: pl.LazyFrame = pl.scan_parquet('s3://...')
df.collect() # fine

# wait an hour (or whatever length AWS access tokens go stale)
df.collect() # fails

Log output

No response

Issue description

I'm having issues with s3 lazy frames. It seems like when I use them immediately after creation and collect()ing it works fine. But I have a long running process where the lazy frame is defined, hours of computation is done, and then the lazy frame gets collected again, and it fails.

Our AWS credentials go stale after ~1hr, so if the computation takes longer than that it seems to fail. As far as I can tell from reading the cred provider code, the tokens are computed when the frame is created, and not when it's collectd

Expected behavior

Tokens are evaluated on collect, not on initialization of the LazyFrame

Installed versions

>>> pl.show_versions()
--------Version info---------
Polars:              1.13.0
Index type:          UInt32
Platform:            macOS-14.4.1-arm64-arm-64bit
Python:              3.9.17 (main, Jun  6 2023, 14:33:55) 
[Clang 14.0.3 (clang-1403.0.22.14.1)]
LTS CPU:             False

----Optional dependencies----
adbc_driver_manager  <not installed>
altair               <not installed>
cloudpickle          3.1.0
connectorx           <not installed>
deltalake            <not installed>
fastexcel            <not installed>
fsspec               2023.12.2
gevent               <not installed>
great_tables         <not installed>
matplotlib           3.9.2
nest_asyncio         <not installed>
numpy                1.26.4
openpyxl             <not installed>
pandas               2.2.3
pyarrow              17.0.0
pydantic             2.9.2
pyiceberg            0.7.1
sqlalchemy           2.0.36
torch                2.0.1
xlsx2csv             <not installed>
xlsxwriter           <not installed>
@kfreisen kfreisen added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Nov 22, 2024
@ritchie46
Copy link
Member

@nameexhaustion it seems that we don't re-auth?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

2 participants