Skip to content

Commit 26fff76

Browse files
authored
feat!: Drop the V2 suffix from data system names (#579)
feat!: Rename the datasystem_config option to data_system
1 parent 9f912e7 commit 26fff76

58 files changed

Lines changed: 409 additions & 415 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎contract-tests/async_client_entity.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
)
1919
from ldclient.config import HTTPConfig
2020
from ldclient.feature_store import CacheConfig
21-
from ldclient.impl.datasourcev2.async_polling import (
21+
from ldclient.impl.datasource.async_polling import (
2222
AsyncFallbackToFDv1PollingDataSourceBuilder,
2323
AsyncPollingDataSourceBuilder
2424
)
25-
from ldclient.impl.datasourcev2.async_streaming import (
25+
from ldclient.impl.datasource.async_streaming import (
2626
AsyncStreamingDataSourceBuilder
2727
)
2828
from ldclient.impl.util import Result
@@ -83,7 +83,7 @@ async def start(self):
8383

8484
datasystem_config = config_params.get('dataSystem')
8585
if datasystem_config is not None:
86-
opts["datasystem_config"] = _build_async_data_system(datasystem_config, opts)
86+
opts["data_system"] = _build_async_data_system(datasystem_config, opts)
8787

8888
if config_params.get("events") is not None:
8989
events = config_params["events"]

‎contract-tests/client_entity.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
streaming_ds_builder
2727
)
2828
from ldclient.feature_store import CacheConfig
29-
from ldclient.impl.datasourcev2.polling import PollingDataSourceBuilder
29+
from ldclient.impl.datasource.polling import PollingDataSourceBuilder
3030
from ldclient.integrations import Consul, DynamoDB, Redis
3131
from ldclient.interfaces import DataStoreMode
3232

@@ -129,7 +129,7 @@ def __init__(self, tag, config):
129129

130130
datasystem.data_store(store, store_mode)
131131

132-
opts["datasystem_config"] = datasystem.build()
132+
opts["data_system"] = datasystem.build()
133133

134134
if config.get("events") is not None:
135135
events = config["events"]

‎docs/api-testing.rst‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Test fixtures
22
=============
33

4-
ldclient.integrations.test_datav2 module
5-
----------------------------------------
4+
ldclient.integrations.test_data module
5+
--------------------------------------
66

7-
The entry point for this feature is :class:`ldclient.integrations.test_datav2.TestDataV2`.
7+
The entry point for this feature is :class:`ldclient.integrations.test_data.TestData`.
88

9-
.. automodule:: ldclient.integrations.test_datav2
9+
.. automodule:: ldclient.integrations.test_data
1010
:members:
1111
:special-members: __init__
1212
:show-inheritance:

‎ldclient/async_client.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(self, config: AsyncConfig):
8888

8989
self._config = config
9090
self._config._instance_id = str(uuid4())
91-
self._datasystem_config = config.datasystem_config or async_datasystem.default().build()
91+
self._data_system_config = config.data_system or async_datasystem.default().build()
9292
self._lifecycle_lock = asyncio.Lock()
9393

9494
self._started = False
@@ -218,13 +218,13 @@ async def __start_up(self, start_wait: float):
218218
# The data system builds its data sources from builders. Give the shared
219219
# session to the builders before the data system starts.
220220
if not self._config.offline:
221-
self._wire_data_source_sessions(self._datasystem_config)
221+
self._wire_data_source_sessions(self._data_system_config)
222222

223223
if self._config.offline:
224224
log.info("Started LaunchDarkly Client in offline mode")
225-
elif _is_daemon_mode(self._datasystem_config):
225+
elif _is_daemon_mode(self._data_system_config):
226226
log.info("Started LaunchDarkly Client in daemon mode")
227-
elif _has_no_data_sources(self._datasystem_config):
227+
elif _has_no_data_sources(self._data_system_config):
228228
log.warning("The data system has no data sources and no persistent store. All evaluations will return default values.")
229229

230230
diagnostic_accumulator = self._set_event_processor(self._config)
@@ -237,7 +237,7 @@ async def __start_up(self, start_wait: float):
237237
update_processor_ready = AsyncEvent()
238238
self._data_system.start(update_processor_ready)
239239

240-
if not self._config.offline and not _is_daemon_mode(self._datasystem_config):
240+
if not self._config.offline and not _is_daemon_mode(self._data_system_config):
241241
if start_wait > 60:
242242
log.warning(f"Client was configured to block for up to {start_wait} seconds when initializing. We recommend blocking no longer than 60.")
243243

@@ -263,16 +263,16 @@ def _get_session(self):
263263
def _make_data_system(self) -> AsyncDataSystem:
264264
from ldclient.impl.datasystem.async_fdv2 import AsyncFDv2
265265

266-
return AsyncFDv2(self._config, self._datasystem_config)
266+
return AsyncFDv2(self._config, self._data_system_config)
267267

268268
def _wire_data_source_sessions(self, data_system_config) -> None:
269269
"""Provide the client's aiohttp session to any async data source
270270
builders so the sources they build share the client's connection pool."""
271-
from ldclient.impl.datasourcev2.async_polling import (
271+
from ldclient.impl.datasource.async_polling import (
272272
AsyncFallbackToFDv1PollingDataSourceBuilder,
273273
AsyncPollingDataSourceBuilder
274274
)
275-
from ldclient.impl.datasourcev2.async_streaming import (
275+
from ldclient.impl.datasource.async_streaming import (
276276
AsyncStreamingDataSourceBuilder
277277
)
278278

‎ldclient/async_config.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def __init__(
166166
plugins: Optional[List[AsyncPlugin]] = None,
167167
enable_event_compression: bool = True,
168168
omit_anonymous_contexts: bool = False,
169-
datasystem_config: Optional[AsyncDataSystemConfig] = None,
169+
data_system: Optional[AsyncDataSystemConfig] = None,
170170
):
171171
"""
172172
:param sdk_key: The SDK key for your LaunchDarkly account. This is always required.
@@ -228,7 +228,7 @@ def __init__(
228228
set this to False to prevent extra CPU use, because the Relay Proxy decompresses and recompresses
229229
the payloads.
230230
:param omit_anonymous_contexts: Sets whether anonymous contexts should be omitted from index and identify events.
231-
:param datasystem_config: Configuration for the data system, which controls how the SDK gets flag and
231+
:param data_system: Configuration for the data system, which controls how the SDK gets flag and
232232
segment data. Build it with the functions in :mod:`ldclient.async_datasystem`. If it is not set, the
233233
SDK uses :func:`ldclient.async_datasystem.default`.
234234
"""
@@ -263,7 +263,7 @@ def __init__(
263263
self.__enable_event_compression = enable_event_compression
264264
self.__omit_anonymous_contexts = omit_anonymous_contexts
265265
self.__instance_id: Optional[str] = None
266-
self._datasystem_config = datasystem_config
266+
self._data_system = data_system
267267

268268
# for internal use only - probably should be part of the client logic
269269
def get_default(self, key, default):
@@ -416,12 +416,12 @@ def _instance_id(self, value: Optional[str]) -> None:
416416
self.__instance_id = value
417417

418418
@property
419-
def datasystem_config(self) -> Optional[AsyncDataSystemConfig]:
419+
def data_system(self) -> Optional[AsyncDataSystemConfig]:
420420
"""
421421
Configuration for the data system, which controls how the SDK gets
422422
flag and segment data.
423423
"""
424-
return self._datasystem_config
424+
return self._data_system
425425

426426
def _validate(self):
427427
if self.offline is False and self.sdk_key == '':

‎ldclient/async_datasystem.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
from ldclient.async_config import AsyncDataSystemConfig
1616
from ldclient.config import DataSourceBuilder
17-
from ldclient.impl.datasourcev2.async_polling import (
17+
from ldclient.impl.datasource.async_polling import (
1818
AsyncFallbackToFDv1PollingDataSourceBuilder,
1919
AsyncPollingDataSourceBuilder
2020
)
21-
from ldclient.impl.datasourcev2.async_streaming import (
21+
from ldclient.impl.datasource.async_streaming import (
2222
AsyncStreamingDataSourceBuilder
2323
)
2424
from ldclient.interfaces import (

‎ldclient/client.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(self, config: Config, start_wait: float = 5):
8989
self._config = config
9090
self._config._instance_id = str(uuid4())
9191
self._config._validate()
92-
self._datasystem_config = config.datasystem_config or datasystem.default().build()
92+
self._data_system_config = config.data_system or datasystem.default().build()
9393

9494
self._event_processor = None
9595
self._event_factory_default = EventFactory(False)
@@ -166,7 +166,7 @@ def _fork_breaks_client(self) -> bool:
166166
"""
167167
if self._config.offline:
168168
return False
169-
if _is_daemon_mode(self._datasystem_config) and not self._config.send_events:
169+
if _is_daemon_mode(self._data_system_config) and not self._config.send_events:
170170
return False
171171
return True
172172

@@ -177,7 +177,7 @@ def __start_up(self, start_wait: float):
177177
self.__hooks_lock = ReadWriteLock()
178178
self.__hooks = self._config.hooks + plugin_hooks # type: List[Hook]
179179

180-
self._data_system: DataSystem = FDv2(self._config, self._datasystem_config)
180+
self._data_system: DataSystem = FDv2(self._config, self._data_system_config)
181181

182182
self.__flag_tracker = FlagTrackerImpl(
183183
self._data_system.flag_change_listeners,
@@ -201,9 +201,9 @@ def __start_up(self, start_wait: float):
201201

202202
if self._config.offline:
203203
log.info("Started LaunchDarkly Client in offline mode")
204-
elif _is_daemon_mode(self._datasystem_config):
204+
elif _is_daemon_mode(self._data_system_config):
205205
log.info("Started LaunchDarkly Client in daemon mode")
206-
elif _has_no_data_sources(self._datasystem_config):
206+
elif _has_no_data_sources(self._data_system_config):
207207
log.warning("The data system has no data sources and no persistent store. All evaluations will return default values.")
208208

209209
diagnostic_accumulator = self._set_event_processor(self._config)
@@ -216,7 +216,7 @@ def __start_up(self, start_wait: float):
216216
update_processor_ready = threading.Event()
217217
self._data_system.start(update_processor_ready)
218218

219-
if not self._config.offline and not _is_daemon_mode(self._datasystem_config):
219+
if not self._config.offline and not _is_daemon_mode(self._data_system_config):
220220
if start_wait > 60:
221221
log.warning(f"Client was configured to block for up to {start_wait} seconds when initializing. We recommend blocking no longer than 60.")
222222

‎ldclient/config.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def __init__(
309309
plugins: Optional[List[Plugin]] = None,
310310
enable_event_compression: bool = True,
311311
omit_anonymous_contexts: bool = False,
312-
datasystem_config: Optional[DataSystemConfig] = None,
312+
data_system: Optional[DataSystemConfig] = None,
313313
):
314314
"""
315315
:param sdk_key: The SDK key for your LaunchDarkly account. This is always required.
@@ -371,7 +371,7 @@ def __init__(
371371
set this to False to prevent extra CPU use, because the Relay Proxy decompresses and recompresses
372372
the payloads.
373373
:param omit_anonymous_contexts: Sets whether anonymous contexts should be omitted from index and identify events.
374-
:param datasystem_config: Configuration for the data system, which controls how the SDK gets flag and
374+
:param data_system: Configuration for the data system, which controls how the SDK gets flag and
375375
segment data. Build it with the functions in :mod:`ldclient.datasystem`. If it is not set, the SDK
376376
uses :func:`ldclient.datasystem.default`.
377377
"""
@@ -406,7 +406,7 @@ def __init__(
406406
self.__enable_event_compression = enable_event_compression
407407
self.__omit_anonymous_contexts = omit_anonymous_contexts
408408
self._instance_id: Optional[str] = None
409-
self._datasystem_config = datasystem_config
409+
self._data_system = data_system
410410

411411
def with_wrapper_information(self, wrapper_name: Optional[str], wrapper_version: Optional[str] = None) -> 'Config':
412412
"""Returns a new ``Config`` instance that is the same as this one, except for having different wrapper information.
@@ -570,12 +570,12 @@ def omit_anonymous_contexts(self) -> bool:
570570
return self.__omit_anonymous_contexts
571571

572572
@property
573-
def datasystem_config(self) -> Optional[DataSystemConfig]:
573+
def data_system(self) -> Optional[DataSystemConfig]:
574574
"""
575575
Configuration for the data system, which controls how the SDK gets
576576
flag and segment data.
577577
"""
578-
return self._datasystem_config
578+
return self._data_system
579579

580580
def _validate(self):
581581
if self.offline is False and self.sdk_key == '':

‎ldclient/datasystem.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from typing import List, Optional
66

77
from ldclient.config import DataSourceBuilder, DataSystemConfig
8-
from ldclient.impl.datasourcev2.polling import (
8+
from ldclient.impl.datasource.polling import (
99
FallbackToFDv1PollingDataSourceBuilder,
1010
PollingDataSourceBuilder
1111
)
12-
from ldclient.impl.datasourcev2.streaming import StreamingDataSourceBuilder
13-
from ldclient.impl.integrations.files.file_data_sourcev2 import (
14-
FileDataSourceV2Builder
12+
from ldclient.impl.datasource.streaming import StreamingDataSourceBuilder
13+
from ldclient.impl.integrations.files.file_data_source import (
14+
FileDataSourceBuilder
1515
)
1616
from ldclient.interfaces import (
1717
DataStoreMode,
@@ -114,11 +114,11 @@ def streaming_ds_builder() -> StreamingDataSourceBuilder:
114114
return StreamingDataSourceBuilder()
115115

116116

117-
def file_ds_builder(paths: List[str]) -> FileDataSourceV2Builder:
117+
def file_ds_builder(paths: List[str]) -> FileDataSourceBuilder:
118118
"""
119119
Returns a builder for a file-based data source.
120120
"""
121-
return FileDataSourceV2Builder(paths)
121+
return FileDataSourceBuilder(paths)
122122

123123

124124
def default() -> ConfigBuilder:

0 commit comments

Comments
 (0)