Ihor Radchenko <[email protected]> writes: > Samuel Culpepper <[email protected]> writes: > >> Hi folks, I wish to add Polars support to the python formatting added in 9.7. >> >> Polars is a simple and fantastic library, akin to pandas, but with a stronger >> foundation in relational logic, and far fewer arcane whiums. >> >> Is there appetite for something like this patch? Please note, I have only >> just hacked this out, and am yet to run/extend the test-suite. > > Looks reasonable, but let me CC the maintainer. > Owned-by: Jack Kamm <[email protected]>
Polars support would be great and a patch would be welcome. I see there's also more refactoring in your patch, I'm open to it as long as it doesn't change any existing behavior (it's a bit hard for me to check as I wasn't able to apply the email as a patch through magit). > Just two comments from me: > 1. That code inside a string is getting very long. It may be a time for > us to move it into a separate .py file for easier editing. Jack, WDYT? Yes I think that would be good. Where should the .py file go? Maybe under etc or a subfolder thereof? Also I'm not sure yet how to get the path and/or contents of the .py file into an elisp variable...the couple ideas that come to mind are: 1. Use a relative path from `load-file-name' from within ob-python.el. We can then import or source this path from the Python side. But this assumes the .py file will also get installed with the elisp files which I am not sure is a good assumption. 2. Generate a elisp file by copying the Python file into a string in it. The elisp file would need to be regenerated whenever the Python file was updated. It would just contain a single defconst string containing the contents of the .py file. When ob-python.el runs, it would create a new tmpfile containing this string which would be sourced from the Python shell.
