Skip to content
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
9 changes: 2 additions & 7 deletions temporalio/envconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 0 additions & 7 deletions tests/test_envconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down