Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: remove validation for resultlogger of upi router in sdk #341

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions sdk/tests/router/config/router_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,41 +197,6 @@ def test_default_router_autoscaling_policy(request):
assert RouterConfig(**config).autoscaling_policy == DEFAULT_AUTOSCALING_POLICY


@pytest.mark.parametrize(
"base_config, log_config, expected",
[
pytest.param(
"minimal_upi_router_config",
LogConfig(result_logger_type=ResultLoggerType.NOP),
None,
),
pytest.param(
"minimal_upi_router_config",
LogConfig(result_logger_type=ResultLoggerType.UPI),
None,
),
pytest.param(
"minimal_upi_router_config",
LogConfig(result_logger_type=ResultLoggerType.KAFKA),
InvalidResultLoggerTypeAndConfigCombination,
),
pytest.param(
"minimal_upi_router_config",
LogConfig(result_logger_type=ResultLoggerType.BIGQUERY),
InvalidResultLoggerTypeAndConfigCombination,
),
],
)
def test_upi_router_log_config_constraint(base_config, log_config, expected, request):
router_config = request.getfixturevalue(base_config)
if expected:
with pytest.raises(expected):
router_config.log_config = log_config
else:
router_config.log_config = log_config
router_config.to_open_api()


@pytest.mark.parametrize(
"base_config, ensembler_config, expected_err",
[
Expand Down
13 changes: 0 additions & 13 deletions sdk/turing/router/config/router_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ def log_config(
self._log_config = LogConfig(**log_config)
else:
self._log_config = log_config
# Verify that only nop or UPI logger is configured for UPI router
if self._protocol == Protocol.UPI:
self._verify_upi_router_logger()

@property
def enricher(self) -> Enricher:
Expand Down Expand Up @@ -422,16 +419,6 @@ def _verify_upi_router_ensembler(self):
f"UPI router only supports no ensembler or standard ensembler."
)

def _verify_upi_router_logger(self):
# only nop or upi logger type is allowed
if not (
self.log_config.result_logger_type == ResultLoggerType.NOP
or self.log_config.result_logger_type == ResultLoggerType.UPI
):
raise turing.router.config.log_config.InvalidResultLoggerTypeAndConfigCombination(
f"UPI router only supports no logging or UPI logger"
)

def to_dict(self):
att_dict = {}
for m in inspect.getmembers(self):
Expand Down
Loading