-
Notifications
You must be signed in to change notification settings - Fork 571
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
Eliminate file intermediary in translate algebra #2267
Eliminate file intermediary in translate algebra #2267
Conversation
…mprove type-hinting
- moves the functionality into a class, so that objects can maintain state without use of a file
Thanks for the PR, quite important I would say, but will have to wait for the next release which hopefully will be not too distant in the future. I will do a thorough review next week. |
This is mainly to avoid increasing our public interface. People should be able to use `translateAlgebra` for most of their needs. Also make slight change to the docstrings.
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 again for the PR, the change looks good, I only renamed AlgebraTranslator
to _AlgebraTranslator
so it is not part of our public API, and I made some small changes to the docstrings, mainly so that references to functions are picked up by Sphinx.
I will merge this after releasing 6.3.2 |
Summary of changes
Previously,
rdflib.plugins.sparql.algebra.translateAlgebra()
maintained state via a file, with a fixed filenamequery.txt
. With this change, use of that file is eliminated; state is now maintained in memory (so that multiple concurrenttranslateAlgebra()
calls, for example, should no longer interfere with each other).The change is accomplished with no change to the client interface. Basically, the actual functionality has been moved into a class, which is instantiated and used as needed (once per call to
algrebra.translateAlgebra()
). The class is available for direct use, though that's not anticipated to be useful in normal operation.Checklist
the same change.
./examples
for new features.CHANGELOG.md
).so maintainers can fix minor issues and keep your PR up to date.