Skip to content

Commit c2351a6

Browse files
author
Matias Melograno
committed
changed log level to warning when split is not present
1 parent e306189 commit c2351a6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

splitio/client/input_validator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def validate_feature_name(feature_name, should_validate_existance, split_storage
268268
return None
269269

270270
if should_validate_existance and split_storage.get(feature_name) is None:
271-
_LOGGER.error(
271+
_LOGGER.warning(
272272
"%s: you passed \"%s\" that does not exist in this environment, "
273273
"please double check what Splits exist in the web console.",
274274
operation,
@@ -380,7 +380,7 @@ def validate_manager_feature_name(feature_name, should_validate_existance, split
380380
return None
381381

382382
if should_validate_existance and split_storage.get(feature_name) is None:
383-
_LOGGER.error(
383+
_LOGGER.warning(
384384
"split: you passed \"%s\" that does not exist in this environment, "
385385
"please double check what Splits exist in the web console.",
386386
feature_name
@@ -421,7 +421,7 @@ def validate_features_get_treatments(features, should_validate_existance=False,
421421

422422
valid_missing_features = set(f for f in filtered_features if split_storage.get(f) is None)
423423
for missing_feature in valid_missing_features:
424-
_LOGGER.error(
424+
_LOGGER.warning(
425425
"%s: you passed \"%s\" that does not exist in this environment, "
426426
"please double check what Splits exist in the web console.",
427427
operation,

tests/client/test_input_validator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def _get_storage_mock(storage):
233233
client._logger.reset_mock()
234234
storage_mock.get.return_value = None
235235
assert client.get_treatment('matching_key', 'some_feature', None) == CONTROL
236-
assert client._logger.error.mock_calls == [
236+
assert client._logger.warning.mock_calls == [
237237
mocker.call(
238238
"%s: you passed \"%s\" that does not exist in this environment, "
239239
"please double check what Splits exist in the web console.",
@@ -461,7 +461,7 @@ def _get_storage_mock(storage):
461461
client._logger.reset_mock()
462462
storage_mock.get.return_value = None
463463
assert client.get_treatment_with_config('matching_key', 'some_feature', None) == (CONTROL, None)
464-
assert client._logger.error.mock_calls == [
464+
assert client._logger.warning.mock_calls == [
465465
mocker.call(
466466
"%s: you passed \"%s\" that does not exist in this environment, "
467467
"please double check what Splits exist in the web console.",
@@ -788,7 +788,7 @@ def _get_storage_mock(storage):
788788
ready_mock.return_value = True
789789
type(factory_mock).ready = ready_mock
790790
assert client.get_treatments('matching_key', ['some_feature'], None) == {'some_feature': CONTROL}
791-
assert client._logger.error.mock_calls == [
791+
assert client._logger.warning.mock_calls == [
792792
mocker.call(
793793
"%s: you passed \"%s\" that does not exist in this environment, "
794794
"please double check what Splits exist in the web console.",
@@ -909,7 +909,7 @@ def _configs(treatment):
909909
ready_mock.return_value = True
910910
type(factory_mock).ready = ready_mock
911911
assert client.get_treatments('matching_key', ['some_feature'], None) == {'some_feature': CONTROL}
912-
assert client._logger.error.mock_calls == [
912+
assert client._logger.warning.mock_calls == [
913913
mocker.call(
914914
"%s: you passed \"%s\" that does not exist in this environment, "
915915
"please double check what Splits exist in the web console.",
@@ -971,7 +971,7 @@ def test_split_(self, mocker):
971971
storage_mock.get.return_value = None
972972
manager.split('nonexistant-split')
973973
assert split_mock.to_split_view.mock_calls == []
974-
assert manager._logger.error.mock_calls == [mocker.call(
974+
assert manager._logger.warning.mock_calls == [mocker.call(
975975
"split: you passed \"%s\" that does not exist in this environment, "
976976
"please double check what Splits exist in the web console.",
977977
'nonexistant-split'

0 commit comments

Comments
 (0)