Skip to content

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 <[email protected]>
Signed-off-by: Alex Nelson <[email protected]>
Signed-off-by: Alex Nelson <[email protected]>
Signed-off-by: Alex Nelson <[email protected]>
Signed-off-by: Alex Nelson <[email protected]>
Signed-off-by: Alex Nelson <[email protected]>
@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 .

"""
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

@ajnelson-nist ajnelson-nist Apr 30, 2024

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 <[email protected]>
Signed-off-by: Alex Nelson <[email protected]>
@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.

2 participants