You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Index.save method raise TypeError on Path argument #174
Index.save method has following declaration: save(path: Optional[PathLike] = None). From python docsPath implements PathLike protocol. So I expected that passing Path object is fine, but I got an error.
TypeError: save(): incompatible function arguments. The following argument types are supported:
1. (self: usearch.compiled.Index, path: str) -> None
Invoked with: <usearch.compiled.Index object at 0x7f5955d810b0>, PosixPath('index.usearch')
I recommend to use either str type annotation or add support for Path objects: e.g. just calling str(path).
Activity
alexbarev commentedon Jul 31, 2023
I think the most accurate solution is to use os.fspath() method, since
PathLikeinterface has related method as you can see from python repo.ashvardanian commentedon Jul 31, 2023
That's a valid suggestion. Already on it!
Fix: Inferring OS-dependant file path in Python
ashvardanian commentedon Jul 31, 2023
Thanks, @AleksandrKent! Fixed, coming in the next release!
Build: Released 0.23.0 [skip ci]
ashvardanian commentedon Aug 5, 2023
🎉 This issue has been resolved in version 0.23.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀