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

Remove the usage of assert in the SPARQLConnector #1186

Merged

Conversation

white-gecko
Copy link
Member

@white-gecko white-gecko commented Oct 8, 2020

Fixes the usage of assert as introduced in #1175 in the SPARQLConnector.

Proposed Changes

In my eyes it is no good practice to have assert in production code, so it should not be in a library.
The Python reference states:

The current code generator emits no code for an assert statement when optimization is requested at compile time.
https://docs.python.org/3/reference/simple_stmts.html#assert

So I think it should be replaced by if and raise an exception.

There are many more usages of assert which should be replaced at some point as well.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 75.395% when pulling b42e5a5 on white-gecko:avoid_using_assert_in_sparqlconnector into 7a53c61 on RDFLib:master.

@nicholascar
Copy link
Member

Merging since the only test fails are that cannot assign address issue!

@nicholascar nicholascar merged commit dde9db8 into RDFLib:master Oct 8, 2020
@white-gecko white-gecko deleted the avoid_using_assert_in_sparqlconnector branch October 8, 2020 15:09
@white-gecko white-gecko added this to the rdflib 6.0.0 milestone Mar 22, 2021
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.

None yet

3 participants