Skip to content

Conversation

@robsdedude
Copy link
Member

(Async)Neo4jBookmarkManager's initial_bookmarks parameter, as well as Bookmarks.from_raw_values values parameter accept anything of type Iterable[str]. Unfortunately, str itself implements that type and yields the characters of the string. That most certainly not what the user intended.

In an ideal world, we could tell the type checker to only accept Iterable[str] when not of type str. See also python/typing#256.

To help users out, we now explicitly check for isinstance(input, str) and turn such inputs into an iterable with the input string as the only element.

(Async)Neo4jBookmarkManager's `initial_bookmarks` parameter, as well as
`Bookmarks.from_raw_values` `values` parameter accept anything of type
`Iterable[str]`. Unfortunately, `str` itself implements that type and yields
the characters of the string. That most certainly not what the user intended.

In an ideal world, we could tell the type checker to only accept `Iterable[str]`
when *not* of type `str`. See also python/typing#256.

To help users out, we now explicitly check for `isinstance(input, str)` and turn
such inputs into an iterable with the input string as the only element.
Copy link
Contributor

@StephenCathcart StephenCathcart left a comment

Choose a reason for hiding this comment

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

🚢

@robsdedude robsdedude merged commit 01d4fdc into neo4j:5.0 Jun 26, 2024
@robsdedude robsdedude deleted the fix/bookmarks-from-raw-values branch June 26, 2024 07:54
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