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

fix: Raise ValueError for unsupported bind_namespace values #1845

Merged
merged 1 commit into from
Apr 19, 2022

Conversation

aucampia
Copy link
Member

@aucampia aucampia commented Apr 18, 2022

This patch changes NamespaceManager.__init__ to raise a ValueError
when it receives an unsupported value for bind_namespaces.

Other changes:

  • Added a Literal type for valid bind_namespaces values, with this
    type checkers will raise an error if an invalid string is supplied as
    an argument.
  • Rename some variables/properties to have a underscore in front to make
    it clear they are not part of the RDFLib public API.

Fixes #1827

@aucampia aucampia marked this pull request as ready for review April 18, 2022 00:11
@aucampia aucampia force-pushed the iwana-20220418T0021-strict_bind_namespaces branch from 691028e to f8bf3a7 Compare April 18, 2022 11:23
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 to see this tidied up.

This patch changes `NamespaceManager.__init__` to raise a `ValueError`
when it receives an unsupported value for `bind_namespaces`.

Other changes:
- Added a Literal type for valid `bind_namespaces` values, with this
  type checkers will raise an error if an invalid string is supplied as
  an argument.
- Rename some variables/properties to have a underscore in front to make
  it clear they are not part of the RDFLib public API.
@aucampia aucampia force-pushed the iwana-20220418T0021-strict_bind_namespaces branch from f8bf3a7 to 6e8c542 Compare April 19, 2022 07:16
@aucampia aucampia merged commit c381e0e into master Apr 19, 2022
@aucampia aucampia deleted the iwana-20220418T0021-strict_bind_namespaces branch May 7, 2022 09:30
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.

rdflib.namespace.NamespaceManager.__init__ does not raise an exception for invalid bind_namespaces options.
2 participants