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: JSON-LD context construction from a dict #2306

Merged

Conversation

aucampia
Copy link
Member

Summary of changes

A variable was only being initialized for string-valued inputs, but if a dict input was passed the variable would still be accessed, resulting in a UnboundLocalError.

This change initializes the variable always, instead of only when string-valued input is used to construct a JSON-LD context.

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.

@aucampia aucampia requested review from hsolbrig and a team March 22, 2023 22:53
@aucampia
Copy link
Member Author

@hsolbrig please have a look if you have time, I think you know this code better than most.

@aucampia aucampia marked this pull request as ready for review March 22, 2023 22:55
@aucampia aucampia force-pushed the iwana-20230322T2346-fix_jsonld_context branch from 08e9a68 to 73fd02e Compare March 22, 2023 22:56
@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 22, 2023
@coveralls
Copy link

coveralls commented Mar 22, 2023

Coverage Status

Coverage: 90.792%. Remained the same when pulling f2da44a on aucampia:iwana-20230322T2346-fix_jsonld_context into 1ab4fc0 on RDFLib:main.

A variable was only being initialized for string-valued inputs, but if a `dict`
input was passed the variable would still be accessed, resulting in a
`UnboundLocalError`.

This change initializes the variable always, instead of only when string-valued
input is used to construct a JSON-LD context.

- Closes <RDFLib#2303>.
@aucampia aucampia force-pushed the iwana-20230322T2346-fix_jsonld_context branch from 73fd02e to f2da44a Compare March 23, 2023 20:16
@aucampia aucampia merged commit 832e693 into RDFLib:main Mar 24, 2023
23 checks passed
@aucampia aucampia deleted the iwana-20230322T2346-fix_jsonld_context branch April 9, 2023 15:04
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
2 participants