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

Fallback to old Store.bind signature on TypeError #2018

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

aucampia
Copy link
Member

@aucampia aucampia commented Jul 13, 2022

Summary of changes

If Store.bind raises a TypeError, and the string conversion of this
TypeError contains override, then log a warning and call Store.bind
without an override.

This is done so that stores that do not accept override on
Store.bind still work, but at the cost of still having the bug that
was fixed by introducing the override parameter.

Also added a private flag which can be used to disable the fix entirely
and never use override when calling Store.bind.

Checklist

  • Checked that there aren't other open pull requests for
    the same change.
  • Added tests for any changes that have a runtime impact.
  • Checked that all tests and type checking passes.
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

@coveralls
Copy link

coveralls commented Jul 13, 2022

Coverage Status

Coverage increased (+0.005%) to 90.365% when pulling 65865ab on aucampia:iwana-20220713T2226-bind_override into ac8ef91 on RDFLib:master.

@aucampia aucampia force-pushed the iwana-20220713T2226-bind_override branch from 937119f to ddb0561 Compare July 14, 2022 13:19
If `Store.bind` raises a `TypeError`, and the string coversion of this
TypeError contains `override`, then log a warning and call `Store.bind`
without an override.

This is done so that stores that do not accept `override` on
`Store.bind` still work, but at the cost of still having the bug that
was fixed by introducing the `override` parameter.

Also added a private flag which can be used to disable the fix entirely
and never use `override` when calling `Store.bind`.
@aucampia aucampia force-pushed the iwana-20220713T2226-bind_override branch from ddb0561 to 65865ab Compare July 14, 2022 13:19
@aucampia aucampia changed the title wip Fallback to old Store.bind signature on TypeError Jul 14, 2022
@aucampia aucampia marked this pull request as ready for review July 14, 2022 13:21
@aucampia aucampia requested a review from a team July 14, 2022 13:21
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, a great HOW-TO example

@aucampia aucampia merged commit 65ccae5 into RDFLib:master Jul 15, 2022
@aucampia aucampia deleted the iwana-20220713T2226-bind_override branch July 17, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addition of override argument to rdflib.store.Store.bind breaks compatibility
2 participants