Skip to content

Commit 63c3282

Browse files
Correcting env
1 parent d922eea commit 63c3282

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
- name: Validate docker
2222
run: |
2323
docker run -e TOOLS_MODE=FOR_DATA_PATTERNS \
24-
-e DREMIO_URI=https://fake \
25-
-e DREMIO_OAUTH_SUPPORTED=false \
24+
-e DREMIOAI_DREMIO__URI=https://fake \
25+
-e DREMIOAI_DREMIO__OAUTH_SUPPORTED=false \
2626
dremio-mcp-server:${{ github.sha }} \
2727
dremio-mcp-server tools list
2828
- name: Install uv

src/dremioai/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class Settings(BaseSettings):
235235
beeai: Optional[BeeAI] = Field(default=None)
236236
model_config = SettingsConfigDict(
237237
env_file=".env",
238-
env_nested_delimiter="_",
238+
env_nested_delimiter="__",
239239
env_prefix="DREMIOAI_",
240240
env_extra="allow",
241241
use_enum_values=True,

tests/config/test_settings.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,20 @@ def test_projects(name: str, project_id: str | None, error: bool):
117117
else:
118118
d = settings.Dremio.model_validate(val)
119119
assert d.project_id == project_id or d.project_id is None and project_id is None
120+
121+
122+
def test_env_file(mock_config_dir):
123+
try:
124+
os.environ["DREMIOAI_DREMIO__URI"] = "https://foo"
125+
os.environ["DREMIOAI_DREMIO__PAT"] = "bar"
126+
os.environ["DREMIOAI_TOOLS__SERVER_MODE"] = "FOR_DATA_PATTERNS"
127+
settings.configure(force=True)
128+
from rich import print as pp
129+
130+
pp(settings.instance().model_dump())
131+
assert settings.instance().dremio.uri == "https://foo"
132+
assert settings.instance().dremio.pat == "bar"
133+
assert settings.instance().tools.server_mode == ToolType.FOR_DATA_PATTERNS
134+
finally:
135+
os.environ.pop("DREMIOAI_DREMIO_URI", None)
136+
os.environ.pop("DREMIOAI_DREMIO_PAT", None)

0 commit comments

Comments
 (0)