-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
test(python): Test S3 functionality using moto server #10164
Conversation
scan_*
functionality on s3storage_options={"endpoint_url": f"http://{host}:{port}"}, | ||
) | ||
assert df.columns == ["category", "calories", "fats_g", "sugars_g"] | ||
assert df.collect().shape == (27, 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems scan_*
are yet to be working properly; tests succeeded on schema reading part, but failed on .collect()
part. This is not moto
's fault, scan_parquet
currently fails on master too.
(try pl.scan_parquet("s3://saturn-public-data/nyc-taxi/data/yellow_tripdata_2019-01.parquet").collect()
and you will see the same error)
py-polars/requirements-dev.txt
Outdated
# Tooling | ||
flask!=2.2.0,!=2.2.1 # Required for moto.server w/o installing all moto[server] dependencies | ||
flask-cors # Required for moto.server w/o installing all moto[server] dependencies | ||
hypothesis==6.82.0 | ||
maturin==1.1.0 | ||
moto[s3]==4.1.13 # Need moto.server to mock s3fs - see aio-libs/aiobotocore#755 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented here, we need moto.server
, not only moto[s3]
. But moto[server]
is a total dependency mess due to cloudwatch support - especially it pins pydantic
to ~1.8
, breaking other tests. We only need S3 part of the server, a brainless pass of manually install flask
is taken for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we maybe elide this problem with a moto github action? https://github.com/getmoto/moto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought a bit and feels like I don't follow what you mean, do you mean launching moto server outside test venv (w/ moto github action) and removing moto dependencies from requirements-dev.txt
? Doesn't it make test_cloud.py
not running under local dev setup?
Our new unit tests in this PR already played its role in detecting #10174 🎊 |
New test suits now pass after #10175 |
A humble ping to reviewers @ritchie46 @stinodego @alexander-beedie that this PR is ready for review. I was a little worried if this test is slow (perhaps too slow to linger overall CI workflow?), but it turns out to be negligible (a few seconds of launching a server is marginal within running all ~3000 tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have left some comments.
py-polars/requirements-dev.txt
Outdated
# Tooling | ||
flask!=2.2.0,!=2.2.1 # Required for moto.server w/o installing all moto[server] dependencies | ||
flask-cors # Required for moto.server w/o installing all moto[server] dependencies | ||
hypothesis==6.82.0 | ||
maturin==1.1.0 | ||
moto[s3]==4.1.13 # Need moto.server to mock s3fs - see aio-libs/aiobotocore#755 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we maybe elide this problem with a moto github action? https://github.com/getmoto/moto
64e2d6a
to
7577ccb
Compare
Thanks a lot for this work @cjackal. I think this is very valuable. I want to leave the final review to @stinodego as he is our CI expert. |
I'll test this out later today or tomorrow! |
@stinodego Just a comment on latest nontrivial commit: |
852766f
to
df7efce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some minor refactoring - this should now be good to go!
Thanks for the effort @cjackal !
As requested by @ritchie46 in #10008