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

Type clone.py node functions #230

Merged

Conversation

ajnelson-nist
Copy link
Contributor

This pull request adds type annotations to functions in clone.py not affected by PR 229.

This PR builds on PR 228.

This patch also removes the `dataclass` symbol import, as linting
reported it is no longer directly used in this module.

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
@ajnelson-nist
Copy link
Contributor Author

@ashleysommer : Thank you for merging #228 .

In case the PR ordering was confusing: This PR was meant to be reviewable and/or mergeable independent of #229 .

@@ -139,7 +139,7 @@ def load_from_source(
:return:
"""
source_is_graph = False
open_source: Optional[BufferedIOBase] = None
open_source: Optional[Union[BufferedIOBase, BinaryIO]] = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of BinaryIO in here?
I added the cast in the previous release specifically to avoid the use of BinaryIO in load.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added BinaryIO per a suggestion from make type-check. There was still a type influence from an open(..., 'rb') call. With your note on using cast to avoid BinaryIO, I've pushed another patch to revert the BinaryIO addition.

This uses `cast()` in line with a prior revision to `load.py`.

Reported-by: Ashley Sommer <ashleysommer@gmail.com>
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
@ashleysommer ashleysommer merged commit b063b74 into RDFLib:master Jun 1, 2024
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

2 participants