Skip to content

Commit a629d87

Browse files
authored
Add import warning admonition on ObjectStore type (#311)
1 parent aa850a7 commit a629d87

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

obstore/python/obstore/store/__init__.pyi

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,16 @@ class MemoryStore:
194194
ObjectStore: TypeAlias = (
195195
AzureStore | GCSStore | HTTPStore | S3Store | LocalStore | MemoryStore
196196
)
197-
"""All supported ObjectStore implementations."""
197+
"""All supported ObjectStore implementations.
198+
199+
!!! warning "Not importable at runtime"
200+
201+
To use this type hint in your code, import it within a `TYPE_CHECKING` block:
202+
203+
```py
204+
from __future__ import annotations
205+
from typing import TYPE_CHECKING
206+
if TYPE_CHECKING:
207+
from obstore.store import ObjectStore
208+
```
209+
"""

0 commit comments

Comments
 (0)