Skip to content

Commit d494584

Browse files
committed
fix: Fix overly generic type hint on File data source
fixes #364
1 parent dc59c94 commit d494584

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ldclient/integrations/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
other than LaunchDarkly.
44
"""
55

6-
from typing import Any, Dict, List, Mapping, Optional
6+
from threading import Event
7+
from typing import Any, Callable, Dict, List, Mapping, Optional
78

9+
from ldclient.config import Config
810
from ldclient.feature_store import CacheConfig
911
from ldclient.feature_store_helpers import CachingStoreWrapper
1012
from ldclient.impl.integrations.consul.consul_feature_store import (
@@ -23,7 +25,7 @@
2325
from ldclient.impl.integrations.redis.redis_feature_store import (
2426
_RedisFeatureStoreCore
2527
)
26-
from ldclient.interfaces import BigSegmentStore
28+
from ldclient.interfaces import BigSegmentStore, FeatureStore, UpdateProcessor
2729

2830

2931
class Consul:
@@ -206,7 +208,7 @@ class Files:
206208
"""Provides factory methods for integrations with filesystem data."""
207209

208210
@staticmethod
209-
def new_data_source(paths: List[str], auto_update: bool = False, poll_interval: float = 1, force_polling: bool = False) -> object:
211+
def new_data_source(paths: List[str], auto_update: bool = False, poll_interval: float = 1, force_polling: bool = False) -> Optional[Callable[[Config, FeatureStore, Event], UpdateProcessor]]:
210212
"""Provides a way to use local files as a source of feature flag state. This would typically be
211213
used in a test environment, to operate using a predetermined feature flag state without an
212214
actual LaunchDarkly connection.

0 commit comments

Comments
 (0)