Skip to content

Commit c2c9245

Browse files
authored
remove validation for resultlogger of upi router in sdk (#341)
1 parent 21ddbb1 commit c2c9245

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

sdk/tests/router/config/router_config_test.py

-35
Original file line numberDiff line numberDiff line change
@@ -197,41 +197,6 @@ def test_default_router_autoscaling_policy(request):
197197
assert RouterConfig(**config).autoscaling_policy == DEFAULT_AUTOSCALING_POLICY
198198

199199

200-
@pytest.mark.parametrize(
201-
"base_config, log_config, expected",
202-
[
203-
pytest.param(
204-
"minimal_upi_router_config",
205-
LogConfig(result_logger_type=ResultLoggerType.NOP),
206-
None,
207-
),
208-
pytest.param(
209-
"minimal_upi_router_config",
210-
LogConfig(result_logger_type=ResultLoggerType.UPI),
211-
None,
212-
),
213-
pytest.param(
214-
"minimal_upi_router_config",
215-
LogConfig(result_logger_type=ResultLoggerType.KAFKA),
216-
InvalidResultLoggerTypeAndConfigCombination,
217-
),
218-
pytest.param(
219-
"minimal_upi_router_config",
220-
LogConfig(result_logger_type=ResultLoggerType.BIGQUERY),
221-
InvalidResultLoggerTypeAndConfigCombination,
222-
),
223-
],
224-
)
225-
def test_upi_router_log_config_constraint(base_config, log_config, expected, request):
226-
router_config = request.getfixturevalue(base_config)
227-
if expected:
228-
with pytest.raises(expected):
229-
router_config.log_config = log_config
230-
else:
231-
router_config.log_config = log_config
232-
router_config.to_open_api()
233-
234-
235200
@pytest.mark.parametrize(
236201
"base_config, ensembler_config, expected_err",
237202
[

sdk/turing/router/config/router_config.py

-13
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,6 @@ def log_config(
277277
self._log_config = LogConfig(**log_config)
278278
else:
279279
self._log_config = log_config
280-
# Verify that only nop or UPI logger is configured for UPI router
281-
if self._protocol == Protocol.UPI:
282-
self._verify_upi_router_logger()
283280

284281
@property
285282
def enricher(self) -> Enricher:
@@ -422,16 +419,6 @@ def _verify_upi_router_ensembler(self):
422419
f"UPI router only supports no ensembler or standard ensembler."
423420
)
424421

425-
def _verify_upi_router_logger(self):
426-
# only nop or upi logger type is allowed
427-
if not (
428-
self.log_config.result_logger_type == ResultLoggerType.NOP
429-
or self.log_config.result_logger_type == ResultLoggerType.UPI
430-
):
431-
raise turing.router.config.log_config.InvalidResultLoggerTypeAndConfigCombination(
432-
f"UPI router only supports no logging or UPI logger"
433-
)
434-
435422
def to_dict(self):
436423
att_dict = {}
437424
for m in inspect.getmembers(self):

0 commit comments

Comments
 (0)