diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d661066e..d7efce71 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.1" + ".": "0.18.2" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 52fcc589..cb44f6c6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 40 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-2fa77c5563df4353049c27f275600e30487ea3fd617770a059a8e8579bedcedb.yml -openapi_spec_hash: 3ae742e1990418d2c01ecac606187887 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-d0b10022e8bcb371d5db9a476396808e779984cee62c9f3d1b042d51a3fbce4a.yml +openapi_spec_hash: 3451ed04f3a6373c7905abb219fc4e30 config_hash: 405ade725d72d542c60de821a127411b diff --git a/CHANGELOG.md b/CHANGELOG.md index 12f9086c..192ddb0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.18.2 (2026-04-14) + +Full Changelog: [v0.18.1...v0.18.2](https://github.com/sentdm/sent-dm-python/compare/v0.18.1...v0.18.2) + +### Bug Fixes + +* ensure file data are only sent as 1 parameter ([c3cc931](https://github.com/sentdm/sent-dm-python/commit/c3cc93144f58651efa4a00c8f71a2e213846e3ee)) + ## 0.18.1 (2026-04-10) Full Changelog: [v0.18.0...v0.18.1](https://github.com/sentdm/sent-dm-python/compare/v0.18.0...v0.18.1) diff --git a/pyproject.toml b/pyproject.toml index cb4f184e..2049e493 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sentdm" -version = "0.18.1" +version = "0.18.2" description = "The official Python library for the Sent API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/sent_dm/_utils/_utils.py b/src/sent_dm/_utils/_utils.py index eec7f4a1..63b8cd60 100644 --- a/src/sent_dm/_utils/_utils.py +++ b/src/sent_dm/_utils/_utils.py @@ -86,8 +86,9 @@ def _extract_items( index += 1 if is_dict(obj): try: - # We are at the last entry in the path so we must remove the field - if (len(path)) == index: + # Remove the field if there are no more dict keys in the path, + # only "" traversal markers or end. + if all(p == "" for p in path[index:]): item = obj.pop(key) else: item = obj[key] diff --git a/src/sent_dm/_version.py b/src/sent_dm/_version.py index 3ecc1e4b..bdd289d0 100644 --- a/src/sent_dm/_version.py +++ b/src/sent_dm/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "sent_dm" -__version__ = "0.18.1" # x-release-please-version +__version__ = "0.18.2" # x-release-please-version diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index eb3def7f..76743d88 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -35,6 +35,15 @@ def test_multiple_files() -> None: assert query == {"documents": [{}, {}]} +def test_top_level_file_array() -> None: + query = {"files": [b"file one", b"file two"], "title": "hello"} + assert extract_files(query, paths=[["files", ""]]) == [ + ("files[]", b"file one"), + ("files[]", b"file two"), + ] + assert query == {"title": "hello"} + + @pytest.mark.parametrize( "query,paths,expected", [