Skip to content

Commit 3fa6fcb

Browse files
style(agent-memory): apply ruff formatting to config.py
1 parent 58c9aaf commit 3fa6fcb

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

src/sap_cloud_sdk/agent_memory/config.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ def __post_init__(self) -> None:
6161
if not self.base_url:
6262
raise AgentMemoryConfigError("base_url must be a non-empty string")
6363
if self.token_url is not None and not self.token_url:
64-
raise AgentMemoryConfigError("token_url must be a non-empty string when provided")
64+
raise AgentMemoryConfigError(
65+
"token_url must be a non-empty string when provided"
66+
)
6567
if self.client_id is not None and not self.client_id:
66-
raise AgentMemoryConfigError("client_id must be a non-empty string when provided")
68+
raise AgentMemoryConfigError(
69+
"client_id must be a non-empty string when provided"
70+
)
6771
if self.client_secret is not None and not self.client_secret:
68-
raise AgentMemoryConfigError("client_secret must be a non-empty string when provided")
72+
raise AgentMemoryConfigError(
73+
"client_secret must be a non-empty string when provided"
74+
)
6975

7076

7177
@dataclass
@@ -81,9 +87,13 @@ class BindingData:
8187
def validate(self) -> None:
8288
"""Raise ``AgentMemoryConfigError`` if any required field is empty."""
8389
if not self.url:
84-
raise AgentMemoryConfigError("Agent Memory binding is missing required field: url")
90+
raise AgentMemoryConfigError(
91+
"Agent Memory binding is missing required field: url"
92+
)
8593
if not self.uaa:
86-
raise AgentMemoryConfigError("Agent Memory binding is missing required field: uaa")
94+
raise AgentMemoryConfigError(
95+
"Agent Memory binding is missing required field: uaa"
96+
)
8797

8898
def extract_config(self) -> AgentMemoryConfig:
8999
"""Parse the UAA JSON string and return an ``AgentMemoryConfig``."""
@@ -116,7 +126,9 @@ def _load_config_from_env() -> AgentMemoryConfig:
116126
Raises:
117127
AgentMemoryConfigError: If configuration cannot be loaded or is incomplete.
118128
"""
119-
from sap_cloud_sdk.core.secret_resolver import read_from_mount_and_fallback_to_env_var
129+
from sap_cloud_sdk.core.secret_resolver import (
130+
read_from_mount_and_fallback_to_env_var,
131+
)
120132

121133
try:
122134
binding = BindingData()

0 commit comments

Comments
 (0)