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

Eliminate file intermediary in translate algebra #2267

Merged

Conversation

jclerman
Copy link
Contributor

Summary of changes

Previously, rdflib.plugins.sparql.algebra.translateAlgebra() maintained state via a file, with a fixed filename query.txt. With this change, use of that file is eliminated; state is now maintained in memory (so that multiple concurrent translateAlgebra() 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

  • Checked that there aren't other open pull requests for
    the same change.
  • Checked that all tests and type checking passes.
  • For changes that have a potential impact on users of this project:
    • Updated relevant documentation to avoid inaccuracies.
    • Considered adding additional documentation (added PyDoc for new class)
    • Considered adding an example in ./examples for new features.
    • Considered updating our changelog (CHANGELOG.md).
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

 - moves the functionality into a class, so that objects can maintain state without use of a file
@coveralls
Copy link

coveralls commented Mar 12, 2023

Coverage Status

Coverage: 90.805% (-0.002%) from 90.807% when pulling 9e06fb8 on jclerman:eliminate-file-intermediary-in-translateAlgebra into 4da67f9 on RDFLib:main.

@aucampia
Copy link
Member

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.

Copy link
Member

@aucampia aucampia left a 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.

@aucampia
Copy link
Member

I will merge this after releasing 6.3.2

@aucampia aucampia added review wanted This indicates that the PR is ready for review ready to merge The PR will be merged soon if no further feedback is provided. labels Mar 26, 2023
@aucampia aucampia requested a review from a team March 26, 2023 14:47
@aucampia aucampia merged commit ae6b859 into RDFLib:main Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The PR will be merged soon if no further feedback is provided. review wanted This indicates that the PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants