Skip to content

Commit 8db5178

Browse files
committed
Remove useless disable_file parameter for ClientConfig.load
1 parent 9423e82 commit 8db5178

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

temporalio/bridge/src/envconfig.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,14 @@ fn load_client_config_inner(
8989
py: Python,
9090
config_source: Option<DataSource>,
9191
config_file_strict: bool,
92-
disable_file: bool,
9392
env_vars: Option<HashMap<String, String>>,
9493
) -> PyResult<PyObject> {
95-
let core_config = if disable_file {
96-
CoreClientConfig::default()
97-
} else {
98-
let options = LoadClientConfigOptions {
99-
config_source,
100-
config_file_strict,
101-
};
102-
core_load_client_config(options, env_vars.as_ref())
103-
.map_err(|e| ConfigError::new_err(format!("{e}")))?
94+
let options = LoadClientConfigOptions {
95+
config_source,
96+
config_file_strict,
10497
};
98+
let core_config = core_load_client_config(options, env_vars.as_ref())
99+
.map_err(|e| ConfigError::new_err(format!("{e}")))?;
105100

106101
core_config_to_dict(py, &core_config)
107102
}
@@ -130,12 +125,11 @@ fn load_client_connect_config_inner(
130125
}
131126

132127
#[pyfunction]
133-
#[pyo3(signature = (path, data, disable_file, config_file_strict, env_vars = None))]
128+
#[pyo3(signature = (path, data, config_file_strict, env_vars = None))]
134129
pub fn load_client_config(
135130
py: Python,
136131
path: Option<String>,
137132
data: Option<Vec<u8>>,
138-
disable_file: bool,
139133
config_file_strict: bool,
140134
env_vars: Option<HashMap<String, String>>,
141135
) -> PyResult<PyObject> {
@@ -153,7 +147,6 @@ pub fn load_client_config(
153147
py,
154148
config_source,
155149
config_file_strict,
156-
disable_file,
157150
env_vars,
158151
)
159152
}

temporalio/envconfig.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ def from_dict(
333333
def load(
334334
*,
335335
config_source: Optional[DataSource] = None,
336-
disable_file: bool = False,
337336
config_file_strict: bool = False,
338337
override_env_vars: Optional[Mapping[str, str]] = None,
339338
) -> ClientConfig:
@@ -348,8 +347,6 @@ def load(
348347
config_source: If present, this is used as the configuration source
349348
instead of default file locations. This can be a path to the file
350349
or the string/byte contents of the file.
351-
disable_file: If true, file loading is disabled. This is only used
352-
when ``config_source`` is not present.
353350
config_file_strict: If true, will TOML file parsing will error on
354351
unrecognized keys.
355352
override_env_vars: The environment variables to use for locating the
@@ -364,7 +361,6 @@ def load(
364361
loaded_profiles = _bridge_envconfig.load_client_config(
365362
path=path,
366363
data=data,
367-
disable_file=disable_file,
368364
config_file_strict=config_file_strict,
369365
env_vars=override_env_vars,
370366
)

tests/test_envconfig.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,6 @@ def test_load_profiles_discovery(tmp_path: Path, monkeypatch): # type: ignore[r
285285
assert "default" in client_config.profiles
286286

287287

288-
def test_load_profiles_disable_file():
289-
"""Test load_profiles with file loading disabled."""
290-
# With no env vars, should be empty
291-
client_config = ClientConfig.load(disable_file=True, override_env_vars={})
292-
assert not client_config.profiles
293-
294-
295288
def test_load_profiles_strict_mode_fail(tmp_path: Path):
296289
"""Test that strict mode fails on unrecognized keys."""
297290
config_file = tmp_path / "config.toml"

0 commit comments

Comments
 (0)