-
Notifications
You must be signed in to change notification settings - Fork 560
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
Streamline typing and implementation of SPARQL processor #2301
Merged
Merged
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
58e34c4
Update processor.py
cthoyt ba256a0
Update evaluate.py
cthoyt 19f03c3
Update processor.py
cthoyt bc58b1f
Update processor.py
cthoyt f686d74
Update processor.py
cthoyt dba8c0b
Update query.py
cthoyt 633c062
Fix typing in remaining processor code
cthoyt d5b8d9a
Update processor.py
cthoyt c444b41
Update processor.py
cthoyt 5dc52cf
Update update.py
cthoyt ded8847
Merge branch 'main' into patch-2
aucampia 259c10d
Revert optionals
cthoyt 0ad0cff
Update query.py
cthoyt aeff7a6
Merge branch 'main' into patch-2
aucampia 99432ec
Revert "Revert optionals"
aucampia ea600b2
restore `rdflib.query.Processor` to its previous state
aucampia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
While the current function signature is problematic due to its use of mutable data structures in argument defaults, One problem with changing this is, plugins that implement this as it stands could break if they now receive valid values according to the new function signature, as they don't expect
None
as a value.We need to figure out a way to upgrade our plugin interfaces, I think the right approach is to create ProcessorV2, but we need to also consider what other changes we want to introduce before that.
I think it is best to change this back to what it was, though the rest of the PR seems good and quite helpful.
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 see how this could be an issue. I will switch the defaults to retain the empty dictionary
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.
Addressed in 259c10d and 0ad0cff
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 don't think 259c10d is really needed, I think it is good to keep it as you had it, because those are not part of our plugin interface.
The only part of your change that relates to the interface is the change to
rdflib.query.Processor
, and here the most critical thing is that we don't want other parts of RDFLib to call plugins in a way or with arguments that they don't support, so if RDFLib code callsrdflib.query.Processor.query
withNone
value for initBindings or initNs then that should result in a type error from mypy.I will revert 259c10d I think, and then remove the optionals in
rdflib.query.Processor
, I will ping you when it is done so you can just confirm that you are happy with it.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.
Done now, please have a look and let me know if things look okay, but essentially I just reverted 259c10d and then changed
rdflib/query.py
back to what is in the main branch.