Is this a support request?
No
Describe the bug
When using Files.new_data_source as a update_processor_class with my Config, as mentioned in the example, mypy throws an error :
error: Argument "update_processor_class" to "Config" has incompatible type "object"; expected "Callable[[Config, FeatureStore, Event], UpdateProcessor] | None" [arg-type]
I believe this is due to the wrong types being specified in either update_processor_class or the return type of new_data_source.
|
class Files: |
|
"""Provides factory methods for integrations with filesystem data.""" |
|
|
|
@staticmethod |
|
def new_data_source(paths: List[str], auto_update: bool = False, poll_interval: float = 1, force_polling: bool = False) -> object: |
|
"""Provides a way to use local files as a source of feature flag state. This would typically be |
|
used in a test environment, to operate using a predetermined feature flag state without an |
|
actual LaunchDarkly connection. |
|
|
|
To use this component, call ``new_data_source``, specifying the file path(s) of your data file(s) |
|
in the ``paths`` parameter; then put the value returned by this method into the ``update_processor_class`` |
|
property of your LaunchDarkly client configuration (:class:`ldclient.config.Config`). |
|
:: |
|
|
|
from ldclient.integrations import Files |
|
data_source = Files.new_data_source(paths=[ myFilePath ]) |
|
config = Config(update_processor_class=data_source) |
|
|
|
@property |
|
def update_processor_class(self) -> Optional[Callable[['Config', FeatureStore, Event], UpdateProcessor]]: |
|
return self.__update_processor_class |
|
|
Expected behavior
There should be no type error when using the method as in the documentation.
SDK version
9.12.0
Is this a support request?
No
Describe the bug
When using
Files.new_data_sourceas aupdate_processor_classwith my Config, as mentioned in the example, mypy throws an error :I believe this is due to the wrong types being specified in either
update_processor_classor the return type ofnew_data_source.python-server-sdk/ldclient/integrations/__init__.py
Lines 205 to 221 in dc59c94
python-server-sdk/ldclient/config.py
Lines 379 to 383 in dc59c94
Expected behavior
There should be no type error when using the method as in the documentation.
SDK version
9.12.0