From e658588d10bb9b95835c8938ab923c6da43fc3e4 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Fri, 15 Aug 2025 15:49:00 -0400 Subject: [PATCH] remove address check --- temporalio/envconfig.py | 9 ++------- tests/test_envconfig.py | 7 ------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/temporalio/envconfig.py b/temporalio/envconfig.py index 0ccf79011..ff68474cb 100644 --- a/temporalio/envconfig.py +++ b/temporalio/envconfig.py @@ -230,15 +230,10 @@ def to_dict(self) -> ClientConfigProfileDict: def to_client_connect_config(self) -> ClientConnectConfig: """Create a `ClientConnectConfig` from this profile.""" - if not self.address: - raise ValueError( - "Configuration profile must contain an 'address' to be used for " - "client connection" - ) - # Only include non-None values config: Dict[str, Any] = {} - config["target_host"] = self.address + if self.address: + config["target_host"] = self.address if self.namespace is not None: config["namespace"] = self.namespace if self.api_key is not None: diff --git a/tests/test_envconfig.py b/tests/test_envconfig.py index 33e2433f6..775c59400 100644 --- a/tests/test_envconfig.py +++ b/tests/test_envconfig.py @@ -505,13 +505,6 @@ async def test_load_client_connect_config(client: Client, tmp_path: Path): assert new_client.namespace == "env-only-namespace" -def test_to_client_connect_config_missing_address_fails(): - """Test that to_client_connect_config raises a ValueError if address is missing.""" - profile = ClientConfigProfile() - with pytest.raises(ValueError, match="must contain an 'address'"): - profile.to_client_connect_config() - - def test_disables_raise_error(): """Test that providing both disable_file and disable_env raises an error.""" with pytest.raises(RuntimeError, match="Cannot disable both"):