Skip to content

Commit 9add012

Browse files
committed
feat: linter
1 parent f00647c commit 9add012

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

flagsmith/flagsmith.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,28 @@ def __init__(
177177

178178
self._initialise_local_evaluation()
179179

180-
if enable_analytics:
181-
self._analytics_processor = AnalyticsProcessor(
182-
environment_key, self.api_url, timeout=self.request_timeout_seconds
183-
)
180+
self._initialise_analytics(
181+
environment_key=environment_key,
182+
enable_analytics=enable_analytics,
183+
pipeline_analytics_config=pipeline_analytics_config,
184+
)
184185

185-
if pipeline_analytics_config:
186-
self._pipeline_analytics_processor = PipelineAnalyticsProcessor(
187-
config=pipeline_analytics_config,
188-
environment_key=environment_key,
189-
)
190-
self._pipeline_analytics_processor.start()
186+
def _initialise_analytics(
187+
self,
188+
environment_key: str,
189+
enable_analytics: bool,
190+
pipeline_analytics_config: typing.Optional[PipelineAnalyticsConfig],
191+
) -> None:
192+
if enable_analytics:
193+
self._analytics_processor = AnalyticsProcessor(
194+
environment_key, self.api_url, timeout=self.request_timeout_seconds
195+
)
196+
if pipeline_analytics_config:
197+
self._pipeline_analytics_processor = PipelineAnalyticsProcessor(
198+
config=pipeline_analytics_config,
199+
environment_key=environment_key,
200+
)
201+
self._pipeline_analytics_processor.start()
191202

192203
def _initialise_local_evaluation(self) -> None:
193204
# To ensure that the environment is set before allowing subsequent

flagsmith/mappers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
StrValueSegmentCondition,
1313
)
1414
from flag_engine.result.types import SegmentResult
15-
from flag_engine.segments.types import ContextValue
1615

1716
from flagsmith.api.types import (
1817
EnvironmentModel,
@@ -26,7 +25,6 @@
2625
SDKEvaluationContext,
2726
SegmentMetadata,
2827
StreamEvent,
29-
TraitConfig,
3028
TraitMapping,
3129
)
3230
from flagsmith.utils.datetime import fromisoformat

0 commit comments

Comments
 (0)