Skip to content

Commit a9fb94e

Browse files
authored
In AzureStore standardize on container_name argument name (#380)
* Azure container_name * Standardize on container_name * Update changelog * update changelog
1 parent 702bb89 commit a9fb94e

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [0.6.0] -
4+
5+
### Breaking changes :wrench:
6+
7+
#### Object store methods
8+
9+
No breaking changes.
10+
11+
#### Store constructors
12+
13+
- In the `AzureStore` constructor, the `container` positional argument was renamed to `container_name` to match the `container_name` key in `AzureConfig`.
14+
15+
This is a breaking change if you had been calling `AzureStore(container="my container name")`. This is not breaking if you had been using it as a positional argument `AzureStore("my container name")` or if you had already been using `AzureStore(container_name="my container name")`.
16+
17+
The idea here is that we want one and only one argument name for each underlying config parameter. Most of these breaking changes took place in 0.5.0, but this was overlooked.
18+
19+
320
## [0.5.1] - 2025-03-17
421

522
### Bug fixes :bug:

obstore/python/obstore/_store/_azure.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -326,19 +326,19 @@ class AzureStore:
326326

327327
def __init__(
328328
self,
329-
container: str | None = None,
329+
container_name: str | None = None,
330330
*,
331331
prefix: str | None = None,
332332
config: AzureConfig | None = None,
333333
client_options: ClientConfig | None = None,
334334
retry_config: RetryConfig | None = None,
335335
credential_provider: AzureCredentialProvider | None = None,
336-
**kwargs: Unpack[AzureConfig],
336+
**kwargs: Unpack[AzureConfig], # type: ignore[GeneralTypeIssues] (container_name key overlaps with positional arg)
337337
) -> None:
338338
"""Construct a new AzureStore.
339339
340340
Args:
341-
container: the name of the container.
341+
container_name: the name of the container.
342342
343343
Keyword Args:
344344
prefix: A prefix within the bucket to use for all operations.

pyo3-object_store/CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [0.3.0] -
4+
5+
### Breaking changes :wrench:
6+
7+
#### Store constructors
8+
9+
- In the `AzureStore` constructor, the `container` positional argument was renamed to `container_name` to match the `container_name` key in `AzureConfig`.
10+
11+
This is a breaking change if you had been calling `AzureStore(container="my container name")`. This is not breaking if you had been using it as a positional argument `AzureStore("my container name")` or if you had already been using `AzureStore(container_name="my container name")`.
12+
13+
## [0.2.0] - 2025-03-14
14+
15+
- Bump to pyo3 0.24.
16+
317
## [0.1.0] - 2025-03-14
418

519
- Initial release.

pyo3-object_store/src/azure/store.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ impl PyAzureStore {
8383
impl PyAzureStore {
8484
// Create from parameters
8585
#[new]
86-
#[pyo3(signature = (container=None, *, prefix=None, config=None, client_options=None, retry_config=None, credential_provider=None, **kwargs))]
86+
#[pyo3(signature = (container_name=None, *, prefix=None, config=None, client_options=None, retry_config=None, credential_provider=None, **kwargs))]
8787
fn new(
88-
container: Option<String>,
88+
container_name: Option<String>,
8989
prefix: Option<PyPath>,
9090
config: Option<PyAzureConfig>,
9191
client_options: Option<PyClientOptions>,
@@ -95,10 +95,10 @@ impl PyAzureStore {
9595
) -> PyObjectStoreResult<Self> {
9696
let mut builder = MicrosoftAzureBuilder::from_env();
9797
let mut config = config.unwrap_or_default();
98-
if let Some(container) = container.clone() {
98+
if let Some(container_name) = container_name {
9999
// Note: we apply the bucket to the config, not directly to the builder, so they stay
100100
// in sync.
101-
config.insert_raising_if_exists(AzureConfigKey::ContainerName, container)?;
101+
config.insert_raising_if_exists(AzureConfigKey::ContainerName, container_name)?;
102102
}
103103
let combined_config = combine_config_kwargs(Some(config), kwargs)?;
104104
builder = combined_config.clone().apply_config(builder);

0 commit comments

Comments
 (0)