-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support for Polars #102
Comments
Hi xyxz-web, export_to_pandas is basically a special implementation of export_to_callback, so the quickest thing would implementing a call back which reads the raw data into polaris. Here is an example for export_to_callback https://github.com/exasol/pyexasol/blob/master/examples/b02_import_export.py. Here you can see how the export_to_pandas callback is called pyexasol/pyexasol/connection.py Line 273 in 63e97d8
Here you can see how the callback is implemented. Line 36 in 63e97d8
It basically reads the CSV coming from the pipe with pandas.read_csv. I think, polars provides almost the same API. https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_csv.html Hope that already helps. |
Hi @xyxz-web, We discussed this internally, and Polars is currently not our roadmap for this project. I hope, you can write your own callback with the of my previous explanation, should you need it. For that reason, I will close this ticket for the moment. |
Hi @tkilias , thanks for your answer! |
Ok, here is the CSV-parsing call in Polars: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_csv.html Implementation is trivial, but we have a few interesting questions to answer: Decimal type? It might be nice to use it automatically for DECIMAL columns. try_parse_dates? rechunk? |
Hi, If you want to implement it and have it merged, I would suggest making polars an optional python dependency, such that user can decide if he would like to install it, because I am not sure about the size of polars and compatibility with different platforms. |
This seems to be working: master...polars The only problem is related to warnings, which I do not know how to mute:
Pyexasol writes into pipe, but polars thinks it's a file. Output:
|
Also, I've double-checked No issues with that. |
I wonder if there has been any progress on this lately. |
Hello, since polars passed version 1.0 recently... |
Hi @raayu83, as far as I understand, this was closed because it is not planned to be implemented. However, I will go and bring this up with our PM. In case this issue is not reopened or linked to a new one, you can safely assume that it is still not planned. best |
Would really love to see Polars support, since it is probably the next big thing after Pandas. |
@raayu83 Good point, I agree. I can tell you that we are generally working on supporting and providing more integrations. In the realm of DataFrames, most notably since the beginning of this year, Ibis has been supporting Exasol, which can be a viable alternative to Pandas depending on the use cases at hand. That said, I will definitely bring your issue forward to our PM, but the decision regarding prioritization is not up to me. |
Hi @raayu83, I just had a discussion with the respective PM. He also agrees that this would be a nice feature, but sadly, it is currently not high enough priority to schedule. Regarding your suggestion/offer:
The feedback was that we will provide assistance for an external PR, including help with test setup and potential project-specific hurdles, as well as code reviews and feedback. However, we can't provide any implementation effort. Side Note: best |
Hi Nico, great to hear you are open for a contribution! |
@raayu83 not yet. However, if you have Poetry installed, setting up the basic project should be straightforward. ℹ️ On Windows, you may encounter issues with one or some of the development (test) dependencies (e.g. itde integration-test-docker-environment). For starters, you could disable them locally if you don't want to run the tests locally. If you do want to run the tests locally and encounter specific problems, we can tackle them then. Here is the workflow for setting up the Poetry project:
Hope that's enough to get you started. best |
Haven't worked with wsl2, but if you install poetry and run everything within WSL2 it may even work "exactly" like on Linux. |
I've tried multiple routes getting the test environment working, allow of which failed at
Click to expand
|
btw, would be ok to reopen the issue? Also, which tools do you use to for code quality and formatting right now? |
I've blindly edited the code for now. |
Got tests running on github. |
Hi @raay83
Fine for me. I'll assign you to the issue, so the team will be aware that the issue is taken care of by someone outside.
Right now, we are using black (If you are interested in the details see python-toolbox). That being said, we are just in the process of adopting/integrating
The main thing I want to avoid is increasing or adding noise to the diffs.
Yes, if you are working on your fork, it should just work if you create a PR. On our repo approval for the runs are also required (I'll should get automatic notification on that though).
Could be, yes but can't tell for sure. |
The integration-test-docker-environment (docker-db) does not work on ARM. |
Ok I need a working local database for debugging this properly... Can't use my company's Exasol for now... The final lines of the container logs say:
So I assume it is running properly? Docker PS says the following:
So I assume I shoud be able to connect with dsn However I get the following error when trying to connect with pyexasol (encryption disabled): Do you have any hints on what I might be doing wrong? |
Hi @raayu83, The default connection details for default Docker-DB are: User: That being said, according to your mapping, the settings you have been using look good from my point of view. Are you using an Intel or an ARM-based Mac? ARM-based Mac "Solutions"
|
Hi @Nicoretti , you are working at Exasol, correct? |
Hi @raayu83, that's not something I can do myself, but I see where you are coming from. If you could send me this inquiry to |
I've now confirmed the error raised is most likely a polars bug, since according to the docs any string or bytes |
I suspect you do not need TextIOWrapper. Send binary stream directly to pollars. Check my original commit for reference: master...polars |
Hi, thanks, I've tried that as well, but it doesn't work anymore. I've opened a bug at polars. |
@raayu83 could you link the bug issue you opened in the polars project here? |
Hi @Nicoretti , sure, please find the issue here: pola-rs/polars#17614 |
Polars is an up and coming alternative for Pandas which already has more then 17.000 GitHub Stars: https://pola-rs.github.io/polars-book/
I wonder if it would be possible to provide an export_to_polars and import_from_polars function without too much effort?
As a workaround Polars could already be used with polars.from_pandas, but this involves copying the whole data.
The text was updated successfully, but these errors were encountered: