From 01f17722315d2653bde060afe034c09fa7119bf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 06:42:21 +0000 Subject: [PATCH 001/105] Bump docutils from 0.20.1 to 0.21.1 Bumps [docutils](https://docutils.sourceforge.io) from 0.20.1 to 0.21.1. --- updated-dependencies: - dependency-name: docutils dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5f2acf0..4af57cd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,7 +10,7 @@ coverage[toml]==7.4.4 dill==0.3.8 -docutils==0.20.1 +docutils==0.21.1 flit==3.9.0 From f104280be40112eb6bc5ca631f4aba749756f960 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 06:13:23 +0000 Subject: [PATCH 002/105] Bump exceptiongroup from 1.2.0 to 1.2.1 Bumps [exceptiongroup](https://github.com/agronholm/exceptiongroup) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/agronholm/exceptiongroup/releases) - [Changelog](https://github.com/agronholm/exceptiongroup/blob/main/CHANGES.rst) - [Commits](https://github.com/agronholm/exceptiongroup/compare/1.2.0...1.2.1) --- updated-dependencies: - dependency-name: exceptiongroup dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f6afff0..1728283 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -66,7 +66,7 @@ zipp==3.18.1 ; python_version >= '3.8' colorama==0.4.6 -exceptiongroup==1.2.0 +exceptiongroup==1.2.1 microsoft-kiota-abstractions==1.3.2 From c9de93be2fcd974c2b9607bdd22ee32cf6f6e168 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 24 Apr 2024 12:21:42 -0400 Subject: [PATCH 003/105] Revert "Bump docutils from 0.20.1 to 0.21.1" --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 294e08f..1728283 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,7 +10,7 @@ coverage[toml]==7.4.4 dill==0.3.8 -docutils==0.21.1 +docutils==0.20.1 flit==3.9.0 From 7458ad6256847e6c3f1e71c0271c27c1e0eed083 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:25:12 +0000 Subject: [PATCH 004/105] Bump coverage[toml] from 7.4.4 to 7.5.0 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.4.4 to 7.5.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.4...7.5.0) --- updated-dependencies: - dependency-name: coverage[toml] dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1728283..2dede9a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ certifi==2024.2.2 charset-normalizer==3.3.2 -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 dill==0.3.8 From a5d09d0e1324251a8ea9bd0126ee124f3d1f36f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:25:37 +0000 Subject: [PATCH 005/105] Bump platformdirs from 4.2.0 to 4.2.1 Bumps [platformdirs](https://github.com/platformdirs/platformdirs) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/platformdirs/platformdirs/releases) - [Changelog](https://github.com/platformdirs/platformdirs/blob/main/CHANGES.rst) - [Commits](https://github.com/platformdirs/platformdirs/compare/4.2.0...4.2.1) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1728283..8f27eb5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mypy-extensions==1.0.0 packaging==24.0 -platformdirs==4.2.0 +platformdirs==4.2.1 pluggy==1.4.0 From 82362a91984e7c036cc441684a9aa6db5cff3159 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:25:40 +0000 Subject: [PATCH 006/105] Bump pluggy from 1.4.0 to 1.5.0 Bumps [pluggy](https://github.com/pytest-dev/pluggy) from 1.4.0 to 1.5.0. - [Changelog](https://github.com/pytest-dev/pluggy/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pluggy/compare/1.4.0...1.5.0) --- updated-dependencies: - dependency-name: pluggy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1728283..1068b5e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -36,7 +36,7 @@ packaging==24.0 platformdirs==4.2.0 -pluggy==1.4.0 +pluggy==1.5.0 pylint==3.1.0 From defeb8db680d136d730acf7276809006bee08f7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 06:08:46 +0000 Subject: [PATCH 007/105] Bump mypy from 1.9.0 to 1.10.0 Bumps [mypy](https://github.com/python/mypy) from 1.9.0 to 1.10.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d8f8f0d..879dff6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -28,7 +28,7 @@ lazy-object-proxy==1.10.0 mccabe==0.7.0 -mypy==1.9.0 +mypy==1.10.0 mypy-extensions==1.0.0 From 59d2d82abb06a4d125a1bd024f13e91981a9fcdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 06:16:37 +0000 Subject: [PATCH 008/105] Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge-dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml index 145487d..72d96dd 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/auto-merge-dependabot.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v2.0.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 60f884d4d4e131376ea7924ae0a3903606103a9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 07:01:00 +0000 Subject: [PATCH 009/105] Bump pytest from 8.1.1 to 8.2.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.2.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.2.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 879dff6..df34f36 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -40,7 +40,7 @@ pluggy==1.5.0 pylint==3.1.0 -pytest==8.1.1 +pytest==8.2.0 pytest-cov==5.0.0 From bcd89abf92488f9c78714114a7edc4617205682e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 06:29:42 +0000 Subject: [PATCH 010/105] Bump coverage[toml] from 7.5.0 to 7.5.1 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.5.0 to 7.5.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.0...7.5.1) --- updated-dependencies: - dependency-name: coverage[toml] dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index df34f36..6847c3d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ certifi==2024.2.2 charset-normalizer==3.3.2 -coverage[toml]==7.5.0 +coverage[toml]==7.5.1 dill==0.3.8 From d3c601583b9cb9cd4fe18dda3a7007e70311b425 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 06:17:21 +0000 Subject: [PATCH 011/105] Bump tomlkit from 0.12.4 to 0.12.5 Bumps [tomlkit](https://github.com/sdispater/tomlkit) from 0.12.4 to 0.12.5. - [Release notes](https://github.com/sdispater/tomlkit/releases) - [Changelog](https://github.com/python-poetry/tomlkit/blob/master/CHANGELOG.md) - [Commits](https://github.com/sdispater/tomlkit/compare/0.12.4...0.12.5) --- updated-dependencies: - dependency-name: tomlkit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 6847c3d..5d601a7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -50,7 +50,7 @@ toml==0.10.2 tomli==2.0.1 -tomlkit==0.12.4 +tomlkit==0.12.5 types-python-dateutil==2.9.0.20240316 From c345b1db3977041f4ba5de8a368c61e3a9fa4ccc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 08:09:27 +0000 Subject: [PATCH 012/105] Bump pylint from 3.1.0 to 3.1.1 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5d601a7..cad627f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -38,7 +38,7 @@ platformdirs==4.2.1 pluggy==1.5.0 -pylint==3.1.0 +pylint==3.1.1 pytest==8.2.0 From 623d20179f00864fe2f91969ebb82ef7ab385d4f Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 14 May 2024 07:44:32 -0400 Subject: [PATCH 013/105] - updates code of conduct to the latest standard --- CODE_OF_CONDUCT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f9ba8cf..686e5e7 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -7,3 +7,4 @@ Resources: - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support) From 5d4395dfd7d1c7290421f962e71f7dc1c06e7e9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 06:20:18 +0000 Subject: [PATCH 014/105] Bump platformdirs from 4.2.1 to 4.2.2 Bumps [platformdirs](https://github.com/platformdirs/platformdirs) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/platformdirs/platformdirs/releases) - [Changelog](https://github.com/platformdirs/platformdirs/blob/main/CHANGES.rst) - [Commits](https://github.com/platformdirs/platformdirs/compare/4.2.1...4.2.2) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index cad627f..9ffa72b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mypy-extensions==1.0.0 packaging==24.0 -platformdirs==4.2.1 +platformdirs==4.2.2 pluggy==1.5.0 From 158939ba10d8aa13f23ec39eecf03147a11999a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 06:09:59 +0000 Subject: [PATCH 015/105] Bump zipp from 3.18.1 to 3.18.2 Bumps [zipp](https://github.com/jaraco/zipp) from 3.18.1 to 3.18.2. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.18.1...v3.18.2) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9ffa72b..e044cec 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -62,7 +62,7 @@ wrapt==1.16.0 yapf==0.40.2 -zipp==3.18.1 ; python_version >= '3.8' +zipp==3.18.2 ; python_version >= '3.8' colorama==0.4.6 From 4e285e8d1624a2e9f99e36eae74a4a9f291e604f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 06:47:41 +0000 Subject: [PATCH 016/105] Bump astroid from 3.1.0 to 3.2.2 Bumps [astroid](https://github.com/pylint-dev/astroid) from 3.1.0 to 3.2.2. - [Release notes](https://github.com/pylint-dev/astroid/releases) - [Changelog](https://github.com/pylint-dev/astroid/blob/main/ChangeLog) - [Commits](https://github.com/pylint-dev/astroid/compare/v3.1.0...v3.2.2) --- updated-dependencies: - dependency-name: astroid dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e044cec..f780ad5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -i https://pypi.org/simple -astroid==3.1.0 +astroid==3.2.2 certifi==2024.2.2 From 2a6e6da56544021f331e5c320f4a644144833a3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 06:47:44 +0000 Subject: [PATCH 017/105] Bump pytest from 8.2.0 to 8.2.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.0 to 8.2.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.0...8.2.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e044cec..0e099fc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -40,7 +40,7 @@ pluggy==1.5.0 pylint==3.1.1 -pytest==8.2.0 +pytest==8.2.1 pytest-cov==5.0.0 From 2089e8b7823fa2283f5845cf9134952a205f93ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 06:55:19 +0000 Subject: [PATCH 018/105] Bump pylint from 3.1.1 to 3.2.1 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.1.1 to 3.2.1. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.1.1...v3.2.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0e099fc..71334dc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -38,7 +38,7 @@ platformdirs==4.2.2 pluggy==1.5.0 -pylint==3.1.1 +pylint==3.2.1 pytest==8.2.1 From a9631624cdee3c51590c754534d5beb277324787 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 05:37:27 +0000 Subject: [PATCH 019/105] --- updated-dependencies: - dependency-name: requests dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 26fb2be..8f70d79 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -44,7 +44,7 @@ pytest==8.2.1 pytest-cov==5.0.0 -requests==2.31.0 +requests==2.32.0 toml==0.10.2 From d80262d8a85b6d784b8578182d3c5275c107299e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 06:59:18 +0000 Subject: [PATCH 020/105] --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8f70d79..49a39f5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -38,7 +38,7 @@ platformdirs==4.2.2 pluggy==1.5.0 -pylint==3.2.1 +pylint==3.2.2 pytest==8.2.1 From ca63d27f4f0c0bc6b522aab51af9cc0a6033c32b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 06:59:40 +0000 Subject: [PATCH 021/105] --- updated-dependencies: - dependency-name: requests dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8f70d79..9716235 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -44,7 +44,7 @@ pytest==8.2.1 pytest-cov==5.0.0 -requests==2.32.0 +requests==2.32.1 toml==0.10.2 From d5256cdcfd147d0bf69fd67feff654a3b84df2fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 06:29:02 +0000 Subject: [PATCH 022/105] --- updated-dependencies: - dependency-name: requests dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dac4d13..bc74a30 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -44,7 +44,7 @@ pytest==8.2.1 pytest-cov==5.0.0 -requests==2.32.1 +requests==2.32.2 toml==0.10.2 From 3d98f0732a3aecc40bbb700925b8ddbcd5e8d668 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 06:25:17 +0000 Subject: [PATCH 023/105] Bump microsoft-kiota-abstractions from 1.3.2 to 1.3.3 Bumps [microsoft-kiota-abstractions](https://github.com/microsoft/kiota) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/microsoft/kiota/releases) - [Changelog](https://github.com/microsoft/kiota/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota/commits) --- updated-dependencies: - dependency-name: microsoft-kiota-abstractions dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index bc74a30..81a506e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -68,7 +68,7 @@ colorama==0.4.6 exceptiongroup==1.2.1 -microsoft-kiota-abstractions==1.3.2 +microsoft-kiota-abstractions==1.3.3 pendulum==3.0.0 From 0f5ae4908ce820f3682cfc1804a1d61203d5effc Mon Sep 17 00:00:00 2001 From: Faith Kangai Date: Thu, 23 May 2024 15:38:34 +0300 Subject: [PATCH 024/105] Update needs-author-feedback label to replacement --- .github/policies/resourceManagement.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index 0f7b81e..dedbd45 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -16,7 +16,7 @@ configuration: - isIssue - isOpen - hasLabel: - label: 'Needs: Author Feedback' + label: 'status:waiting-for-author-feedback' - hasLabel: label: 'Status: No Recent Activity' - noActivitySince: @@ -31,7 +31,7 @@ configuration: - isIssue - isOpen - hasLabel: - label: 'Needs: Author Feedback' + label: 'status:waiting-for-author-feedback' - noActivitySince: days: 4 - isNotLabeledWith: @@ -64,13 +64,13 @@ configuration: - isActivitySender: issueAuthor: True - hasLabel: - label: 'Needs: Author Feedback' + label: 'status:waiting-for-author-feedback' - isOpen then: - addLabel: label: 'Needs: Attention :wave:' - removeLabel: - label: 'Needs: Author Feedback' + label: 'status:waiting-for-author-feedback' description: - if: - payloadType: Issues From eadd5c372ba883a0b108b3b476e9d20babdeffbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 May 2024 06:10:29 +0000 Subject: [PATCH 025/105] Bump typing-extensions from 4.11.0 to 4.12.0 Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.11.0 to 4.12.0. - [Release notes](https://github.com/python/typing_extensions/releases) - [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md) - [Commits](https://github.com/python/typing_extensions/compare/4.11.0...4.12.0) --- updated-dependencies: - dependency-name: typing-extensions dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 81a506e..dd4b505 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -54,7 +54,7 @@ tomlkit==0.12.5 types-python-dateutil==2.9.0.20240316 -typing-extensions==4.11.0 +typing-extensions==4.12.0 urllib3==2.2.1 From 7c54b03844b71c21490be6736301627a783932ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 06:49:17 +0000 Subject: [PATCH 026/105] Bump zipp from 3.18.2 to 3.19.0 Bumps [zipp](https://github.com/jaraco/zipp) from 3.18.2 to 3.19.0. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.18.2...v3.19.0) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dd4b505..0ab39ce 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -62,7 +62,7 @@ wrapt==1.16.0 yapf==0.40.2 -zipp==3.18.2 ; python_version >= '3.8' +zipp==3.19.0 ; python_version >= '3.8' colorama==0.4.6 From deed867df5807599575a5b80e7c28ddf477591a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 06:49:30 +0000 Subject: [PATCH 027/105] Bump coverage[toml] from 7.5.1 to 7.5.2 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.5.1 to 7.5.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.1...7.5.2) --- updated-dependencies: - dependency-name: coverage[toml] dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dd4b505..30b5b92 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ certifi==2024.2.2 charset-normalizer==3.3.2 -coverage[toml]==7.5.1 +coverage[toml]==7.5.2 dill==0.3.8 From 36044dcb6303e6fc246fb9b1c823e8e2f21e7864 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 06:06:09 +0000 Subject: [PATCH 028/105] Bump coverage[toml] from 7.5.2 to 7.5.3 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.5.2 to 7.5.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.2...7.5.3) --- updated-dependencies: - dependency-name: coverage[toml] dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index fdd2319..a5aa4f1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ certifi==2024.2.2 charset-normalizer==3.3.2 -coverage[toml]==7.5.2 +coverage[toml]==7.5.3 dill==0.3.8 From b70093a208954032a7ea7b03b30d9364e5269a3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 06:58:45 +0000 Subject: [PATCH 029/105] Bump requests from 2.32.2 to 2.32.3 Bumps [requests](https://github.com/psf/requests) from 2.32.2 to 2.32.3. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.32.2...v2.32.3) --- updated-dependencies: - dependency-name: requests dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a5aa4f1..3bf5a8c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -44,7 +44,7 @@ pytest==8.2.1 pytest-cov==5.0.0 -requests==2.32.2 +requests==2.32.3 toml==0.10.2 From c0f7914a142d3241ccbb5581277bb46186b3e2ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 06:34:51 +0000 Subject: [PATCH 030/105] Bump certifi from 2024.2.2 to 2024.6.2 Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.2.2 to 2024.6.2. - [Commits](https://github.com/certifi/python-certifi/compare/2024.02.02...2024.06.02) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3bf5a8c..4a79068 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ astroid==3.2.2 -certifi==2024.2.2 +certifi==2024.6.2 charset-normalizer==3.3.2 From 69646a737feef31f307e92159b747625c69c1f17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 06:34:59 +0000 Subject: [PATCH 031/105] Bump zipp from 3.19.0 to 3.19.1 Bumps [zipp](https://github.com/jaraco/zipp) from 3.19.0 to 3.19.1. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.19.0...v3.19.1) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3bf5a8c..5fc9e64 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -62,7 +62,7 @@ wrapt==1.16.0 yapf==0.40.2 -zipp==3.19.0 ; python_version >= '3.8' +zipp==3.19.1 ; python_version >= '3.8' colorama==0.4.6 From 912d94acaf3150ba25ee2cc4365ae8c2d032bcbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 06:35:02 +0000 Subject: [PATCH 032/105] Bump typing-extensions from 4.12.0 to 4.12.1 Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.12.0 to 4.12.1. - [Release notes](https://github.com/python/typing_extensions/releases) - [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md) - [Commits](https://github.com/python/typing_extensions/compare/4.12.0...4.12.1) --- updated-dependencies: - dependency-name: typing-extensions dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3bf5a8c..22dce64 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -54,7 +54,7 @@ tomlkit==0.12.5 types-python-dateutil==2.9.0.20240316 -typing-extensions==4.12.0 +typing-extensions==4.12.1 urllib3==2.2.1 From 8ee1001a12fffd93f19bc1faac872307aab25dbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 06:39:27 +0000 Subject: [PATCH 033/105] Bump pytest from 8.2.1 to 8.2.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.1 to 8.2.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.1...8.2.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1239fd2..393e186 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -40,7 +40,7 @@ pluggy==1.5.0 pylint==3.2.2 -pytest==8.2.1 +pytest==8.2.2 pytest-cov==5.0.0 From 1e128e5925772bcb16f4ba5ad972adbb110a0a03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 06:39:38 +0000 Subject: [PATCH 034/105] Bump zipp from 3.19.1 to 3.19.2 Bumps [zipp](https://github.com/jaraco/zipp) from 3.19.1 to 3.19.2. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.19.1...v3.19.2) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1239fd2..0eaf8cc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -62,7 +62,7 @@ wrapt==1.16.0 yapf==0.40.2 -zipp==3.19.1 ; python_version >= '3.8' +zipp==3.19.2 ; python_version >= '3.8' colorama==0.4.6 From c76aabc3431892930e48129ea61713aa9da454fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 06:44:17 +0000 Subject: [PATCH 035/105] Bump pylint from 3.2.2 to 3.2.3 Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.2 to 3.2.3. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.2...v3.2.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8662f9f..89caef8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -38,7 +38,7 @@ platformdirs==4.2.2 pluggy==1.5.0 -pylint==3.2.2 +pylint==3.2.3 pytest==8.2.2 From 13dca187d89fd3a27688a88b83295c1255c9c1d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 06:30:31 +0000 Subject: [PATCH 036/105] Bump typing-extensions from 4.12.1 to 4.12.2 Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.12.1 to 4.12.2. - [Release notes](https://github.com/python/typing_extensions/releases) - [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md) - [Commits](https://github.com/python/typing_extensions/compare/4.12.1...4.12.2) --- updated-dependencies: - dependency-name: typing-extensions dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 89caef8..c1fc094 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -54,7 +54,7 @@ tomlkit==0.12.5 types-python-dateutil==2.9.0.20240316 -typing-extensions==4.12.1 +typing-extensions==4.12.2 urllib3==2.2.1 From 79b35985de150d7673caab558060920813aaca5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 06:30:41 +0000 Subject: [PATCH 037/105] Bump packaging from 24.0 to 24.1 Bumps [packaging](https://github.com/pypa/packaging) from 24.0 to 24.1. - [Release notes](https://github.com/pypa/packaging/releases) - [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pypa/packaging/compare/24.0...24.1) --- updated-dependencies: - dependency-name: packaging dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 89caef8..6002f89 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -32,7 +32,7 @@ mypy==1.10.0 mypy-extensions==1.0.0 -packaging==24.0 +packaging==24.1 platformdirs==4.2.2 From 3637363a390d839f6578952eb739889d5e01b0c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:52:53 +0000 Subject: [PATCH 038/105] Bump urllib3 from 2.2.1 to 2.2.2 Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.2.1...2.2.2) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 861d5bc..fa3e7c0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -56,7 +56,7 @@ types-python-dateutil==2.9.0.20240316 typing-extensions==4.12.2 -urllib3==2.2.1 +urllib3==2.2.2 wrapt==1.16.0 From e58444649394906a18c35b69bb90e203452aa156 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 06:09:22 +0000 Subject: [PATCH 039/105] Bump coverage[toml] from 7.5.3 to 7.5.4 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.5.3 to 7.5.4. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.3...7.5.4) --- updated-dependencies: - dependency-name: coverage[toml] dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index fa3e7c0..4ead401 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ certifi==2024.6.2 charset-normalizer==3.3.2 -coverage[toml]==7.5.3 +coverage[toml]==7.5.4 dill==0.3.8 From 6eee27d0cd2e08d07df911b9f7e8295fc5b8e2d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 06:29:27 +0000 Subject: [PATCH 040/105] Bump mypy from 1.10.0 to 1.10.1 Bumps [mypy](https://github.com/python/mypy) from 1.10.0 to 1.10.1. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.10.0...v1.10.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4ead401..b734c2e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -28,7 +28,7 @@ lazy-object-proxy==1.10.0 mccabe==0.7.0 -mypy==1.10.0 +mypy==1.10.1 mypy-extensions==1.0.0 From b951bb9cb1107592e93e356046f139fb85bf7b1c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 26 Jun 2024 14:09:10 -0400 Subject: [PATCH 041/105] chore: adds pylint dependabot group to avoid dependencies misalignments --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c78c2ed..e9b8cea 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,14 @@ updates: schedule: interval: daily open-pull-requests-limit: 10 + groups: + open-telemetry: + patterns: + - "*opentelemetry*" + pylint: + patterns: + - "*pylint*" + - "*astroid*" - package-ecosystem: github-actions directory: "/" schedule: From 95c1488f8dc3b30efef35bdb53663caaa21bb8a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 21:05:29 +0000 Subject: [PATCH 042/105] Bump pylint from 3.2.3 to 3.2.4 in the pylint group Bumps the pylint group with 1 update: [pylint](https://github.com/pylint-dev/pylint). Updates `pylint` from 3.2.3 to 3.2.4 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.3...v3.2.4) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pylint ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b734c2e..49555b6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -38,7 +38,7 @@ platformdirs==4.2.2 pluggy==1.5.0 -pylint==3.2.3 +pylint==3.2.4 pytest==8.2.2 From d718e3bd637f0f9bf739b599881ad354873041b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 06:24:32 +0000 Subject: [PATCH 043/105] Bump pylint from 3.2.4 to 3.2.5 in the pylint group Bumps the pylint group with 1 update: [pylint](https://github.com/pylint-dev/pylint). Updates `pylint` from 3.2.4 to 3.2.5 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.4...v3.2.5) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pylint ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 49555b6..c20c3a1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -38,7 +38,7 @@ platformdirs==4.2.2 pluggy==1.5.0 -pylint==3.2.4 +pylint==3.2.5 pytest==8.2.2 From 2ce9f253563a42548c126c1484bb15c57948822a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 06:17:02 +0000 Subject: [PATCH 044/105] Bump certifi from 2024.6.2 to 2024.7.4 Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.6.2 to 2024.7.4. - [Commits](https://github.com/certifi/python-certifi/compare/2024.06.02...2024.07.04) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c20c3a1..69a7f67 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ astroid==3.2.2 -certifi==2024.6.2 +certifi==2024.7.4 charset-normalizer==3.3.2 From 42876614acb6ac3e546a71b008d26144732b2bad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 06:55:10 +0000 Subject: [PATCH 045/105] Bump dependabot/fetch-metadata from 2.1.0 to 2.2.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge-dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml index 72d96dd..3d9334e 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/auto-merge-dependabot.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v2.1.0 + uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From fa0edb7558294c908ae040b2832c8cc35df1860e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 06:33:40 +0000 Subject: [PATCH 046/105] Bump tomlkit from 0.12.5 to 0.13.0 Bumps [tomlkit](https://github.com/sdispater/tomlkit) from 0.12.5 to 0.13.0. - [Release notes](https://github.com/sdispater/tomlkit/releases) - [Changelog](https://github.com/python-poetry/tomlkit/blob/master/CHANGELOG.md) - [Commits](https://github.com/sdispater/tomlkit/compare/0.12.5...0.13.0) --- updated-dependencies: - dependency-name: tomlkit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 69a7f67..ac3c4a4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -50,7 +50,7 @@ toml==0.10.2 tomli==2.0.1 -tomlkit==0.12.5 +tomlkit==0.13.0 types-python-dateutil==2.9.0.20240316 From 9da77376c08c6c169b93f03b397ebb348296ad6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:49:58 +0000 Subject: [PATCH 047/105] Bump astroid from 3.2.2 to 3.2.3 in the pylint group Bumps the pylint group with 1 update: [astroid](https://github.com/pylint-dev/astroid). Updates `astroid` from 3.2.2 to 3.2.3 - [Release notes](https://github.com/pylint-dev/astroid/releases) - [Changelog](https://github.com/pylint-dev/astroid/blob/main/ChangeLog) - [Commits](https://github.com/pylint-dev/astroid/compare/v3.2.2...v3.2.3) --- updated-dependencies: - dependency-name: astroid dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pylint ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ac3c4a4..b12b3a9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -i https://pypi.org/simple -astroid==3.2.2 +astroid==3.2.3 certifi==2024.7.4 From 1c96db5bb283d84bf66b870ddf44680c90c9b2ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:50:04 +0000 Subject: [PATCH 048/105] Bump coverage[toml] from 7.5.4 to 7.6.0 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.5.4 to 7.6.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.4...7.6.0) --- updated-dependencies: - dependency-name: coverage[toml] dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ac3c4a4..ed525a7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ certifi==2024.7.4 charset-normalizer==3.3.2 -coverage[toml]==7.5.4 +coverage[toml]==7.6.0 dill==0.3.8 From 1a5c52b22e3585bc46e4d441269a8872bdb16fee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 06:20:59 +0000 Subject: [PATCH 049/105] Bump exceptiongroup from 1.2.1 to 1.2.2 Bumps [exceptiongroup](https://github.com/agronholm/exceptiongroup) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/agronholm/exceptiongroup/releases) - [Changelog](https://github.com/agronholm/exceptiongroup/blob/main/CHANGES.rst) - [Commits](https://github.com/agronholm/exceptiongroup/compare/1.2.1...1.2.2) --- updated-dependencies: - dependency-name: exceptiongroup dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 26aef24..35270d9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -66,7 +66,7 @@ zipp==3.19.2 ; python_version >= '3.8' colorama==0.4.6 -exceptiongroup==1.2.1 +exceptiongroup==1.2.2 microsoft-kiota-abstractions==1.3.3 From 8dd597b86fef46cf70646744a9654ea8be888130 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 06:28:25 +0000 Subject: [PATCH 050/105] Bump the pylint group with 2 updates Bumps the pylint group with 2 updates: [astroid](https://github.com/pylint-dev/astroid) and [pylint](https://github.com/pylint-dev/pylint). Updates `astroid` from 3.2.3 to 3.2.4 - [Release notes](https://github.com/pylint-dev/astroid/releases) - [Changelog](https://github.com/pylint-dev/astroid/blob/main/ChangeLog) - [Commits](https://github.com/pylint-dev/astroid/compare/v3.2.3...v3.2.4) Updates `pylint` from 3.2.5 to 3.2.6 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.5...v3.2.6) --- updated-dependencies: - dependency-name: astroid dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pylint - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pylint ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 35270d9..3fa6245 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -i https://pypi.org/simple -astroid==3.2.3 +astroid==3.2.4 certifi==2024.7.4 @@ -38,7 +38,7 @@ platformdirs==4.2.2 pluggy==1.5.0 -pylint==3.2.5 +pylint==3.2.6 pytest==8.2.2 From 62a0f33445f7b85062019d65f5e44df4ff4bf12a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 06:28:29 +0000 Subject: [PATCH 051/105] Bump mypy from 1.10.1 to 1.11.0 Bumps [mypy](https://github.com/python/mypy) from 1.10.1 to 1.11.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.10.1...v1.11) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 35270d9..6e5d74f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -28,7 +28,7 @@ lazy-object-proxy==1.10.0 mccabe==0.7.0 -mypy==1.10.1 +mypy==1.11.0 mypy-extensions==1.0.0 From 79a456301dbe19f84cfb3ad358346c0e67518374 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 06:28:38 +0000 Subject: [PATCH 052/105] Bump pytest from 8.2.2 to 8.3.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 35270d9..c05092b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -40,7 +40,7 @@ pluggy==1.5.0 pylint==3.2.5 -pytest==8.2.2 +pytest==8.3.1 pytest-cov==5.0.0 From 5b79cb7c6d443f383a2757d920e1325a6c50de1c Mon Sep 17 00:00:00 2001 From: Acurisu Date: Wed, 24 Jul 2024 11:22:48 +0200 Subject: [PATCH 053/105] Support dict[str, Any] --- .../json_serialization_writer.py | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/kiota_serialization_json/json_serialization_writer.py b/kiota_serialization_json/json_serialization_writer.py index 8fc5ed4..9a511dd 100644 --- a/kiota_serialization_json/json_serialization_writer.py +++ b/kiota_serialization_json/json_serialization_writer.py @@ -203,7 +203,7 @@ def write_collection_of_primitive_values( if isinstance(values, list): result = [] for val in values: - temp_writer = self._create_new_writer() + temp_writer: JsonSerializationWriter = self._create_new_writer() temp_writer.write_any_value(None, val) result.append(temp_writer.value) @@ -253,6 +253,26 @@ def write_collection_of_enum_values( else: self.value = result + def write_collection_of_dict_values( + self, key: Optional[str], values: Optional[List[Dict[str, Any]]] + ) -> None: + """Writes the specified collection of dictionary values to the stream with an optional given key. + Args: + key (Optional[str]): The key to be used for the written value. May be null. + values (Optional[List[Dict[str, Any]]]): The collection of dictionary values to be written. + """ + if isinstance(values, list): + result = [] + for val in values: + temp_writer: JsonSerializationWriter = self._create_new_writer() + temp_writer.write_dict_value(None, val) + result.append(temp_writer.value) + + if key: + self.writer[key] = result + else: + self.value = result + def write_bytes_value(self, key: Optional[str], value: bytes) -> None: """Writes the specified byte array as a base64 string to the stream with an optional given key. @@ -320,6 +340,21 @@ def write_null_value(self, key: Optional[str]) -> None: else: self.value = "null" + def write_dict_value(self, key: Optional[str], value: Dict[str, Any]) -> None: + """Writes the specified dictionary value to the stream with an optional given key. + Args: + key (Optional[str]): The key to be used for the written value. May be null. + value (Dict[str, Any]): The dictionary value to be written. + """ + if isinstance(value, dict): + temp_writer: JsonSerializationWriter = self._create_new_writer() + for dict_key, dict_value in value.items(): + temp_writer.write_any_value(dict_key, dict_value) + if key: + self.writer[key] = temp_writer.writer + else: + self.value = temp_writer.writer + def write_additional_data_value(self, value: Dict[str, Any]) -> None: """Writes the specified additional data to the stream. Args: @@ -440,11 +475,15 @@ def write_any_value(self, key: Optional[str], value: Any) -> Any: self.write_collection_of_enum_values(key, value) elif all((type(x) in PRIMITIVE_TYPES) for x in value): self.write_collection_of_primitive_values(key, value) + elif all(isinstance(x, dict) for x in value): + self.write_collection_of_dict_values(key, value) else: raise TypeError( f"Encountered an unknown collection type during serialization \ {value_type} with key {key}" ) + elif isinstance(value, dict): + self.write_dict_value(key, value) elif hasattr(value, '__dict__'): self.write_non_parsable_object_value(key, value) else: From 3ec978f3d2705b33aec56be486be54652546f622 Mon Sep 17 00:00:00 2001 From: Acurisu Date: Wed, 24 Jul 2024 12:29:55 +0200 Subject: [PATCH 054/105] Updated tests to use dict[str, Any] --- tests/unit/conftest.py | 7 ++++++- tests/unit/test_json_parse_node.py | 8 ++++++++ tests/unit/test_json_serialization_writer.py | 10 ++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 702b6a5..bca9a29 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -19,7 +19,12 @@ def user1_json(): '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ '"approvers": [{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ - '{"display_name": "John Doe", "age": 32}]}}' + '{"display_name": "John Doe", "age": 32}], '\ + '"data": {'\ + '"groups": ['\ + '{"friends": [{"display_name": "John Doe", "age": 32}]}'\ + ']'\ + '}}}'\ @pytest.fixture diff --git a/tests/unit/test_json_parse_node.py b/tests/unit/test_json_parse_node.py index d5c605a..a2e95ba 100644 --- a/tests/unit/test_json_parse_node.py +++ b/tests/unit/test_json_parse_node.py @@ -137,6 +137,14 @@ def test_get_object_value(user1_json): "age": 32 } ] + assert result.additional_data["additional_data"]["data"] == { + "groups": [{ + "friends": [{ + "display_name": "John Doe", + "age": 32 + }] + }] + } def test_get_collection_of_object_values(users_json): diff --git a/tests/unit/test_json_serialization_writer.py b/tests/unit/test_json_serialization_writer.py index 925024d..02ce3f6 100644 --- a/tests/unit/test_json_serialization_writer.py +++ b/tests/unit/test_json_serialization_writer.py @@ -254,7 +254,12 @@ def test_write_additional_data_value(user_1, user_2): "businessPhones": ["+1 205 555 0108"], "manager": user_1, "approvers": [user_1, user_2], - "created_at": date(2022, 1, 27) + "created_at": date(2022, 1, 27), + "data": { + "groups": [{ + "friends": [user_2] + }] + } } ) content = json_serialization_writer.get_serialized_content() @@ -266,4 +271,5 @@ def test_write_additional_data_value(user_1, user_2): '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ '"approvers": [{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ - '{"display_name": "John Doe", "age": 32}], "created_at": "2022-01-27"}' + '{"display_name": "John Doe", "age": 32}], "created_at": "2022-01-27", '\ + '"data": {"groups": [{"friends": [{"display_name": "John Doe", "age": 32}]}]}}' From a79488a49786b10cedaa22bec62d4fca100a1a73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 06:55:12 +0000 Subject: [PATCH 055/105] Bump pytest from 8.3.1 to 8.3.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.1 to 8.3.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.1...8.3.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 87aa561..e446e86 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -40,7 +40,7 @@ pluggy==1.5.0 pylint==3.2.6 -pytest==8.3.1 +pytest==8.3.2 pytest-cov==5.0.0 From c1f4bbf0e17d5f0c7af4f8483f0ac2688a41972e Mon Sep 17 00:00:00 2001 From: Acurisu Date: Fri, 26 Jul 2024 10:41:16 +0200 Subject: [PATCH 056/105] resolve comments --- CHANGELOG.md | 7 +++++++ kiota_serialization_json/_version.py | 2 +- kiota_serialization_json/json_serialization_writer.py | 10 +++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e50400c..244cbe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.0] - 2024-07-26 + +### Added +- Support `dict[str, Any]` and `list[dict[str, Any]]` when writing additional data. + +### Changed + ## [1.2.0] - 2024-04-09 ### Added diff --git a/kiota_serialization_json/_version.py b/kiota_serialization_json/_version.py index a9ecfe2..3810552 100644 --- a/kiota_serialization_json/_version.py +++ b/kiota_serialization_json/_version.py @@ -1 +1 @@ -VERSION: str = '1.2.0' +VERSION: str = '1.3.0' diff --git a/kiota_serialization_json/json_serialization_writer.py b/kiota_serialization_json/json_serialization_writer.py index 9a511dd..338ddc7 100644 --- a/kiota_serialization_json/json_serialization_writer.py +++ b/kiota_serialization_json/json_serialization_writer.py @@ -253,7 +253,7 @@ def write_collection_of_enum_values( else: self.value = result - def write_collection_of_dict_values( + def __write_collection_of_dict_values( self, key: Optional[str], values: Optional[List[Dict[str, Any]]] ) -> None: """Writes the specified collection of dictionary values to the stream with an optional given key. @@ -265,7 +265,7 @@ def write_collection_of_dict_values( result = [] for val in values: temp_writer: JsonSerializationWriter = self._create_new_writer() - temp_writer.write_dict_value(None, val) + temp_writer.__write_dict_value(None, val) result.append(temp_writer.value) if key: @@ -340,7 +340,7 @@ def write_null_value(self, key: Optional[str]) -> None: else: self.value = "null" - def write_dict_value(self, key: Optional[str], value: Dict[str, Any]) -> None: + def __write_dict_value(self, key: Optional[str], value: Dict[str, Any]) -> None: """Writes the specified dictionary value to the stream with an optional given key. Args: key (Optional[str]): The key to be used for the written value. May be null. @@ -476,14 +476,14 @@ def write_any_value(self, key: Optional[str], value: Any) -> Any: elif all((type(x) in PRIMITIVE_TYPES) for x in value): self.write_collection_of_primitive_values(key, value) elif all(isinstance(x, dict) for x in value): - self.write_collection_of_dict_values(key, value) + self.__write_collection_of_dict_values(key, value) else: raise TypeError( f"Encountered an unknown collection type during serialization \ {value_type} with key {key}" ) elif isinstance(value, dict): - self.write_dict_value(key, value) + self.__write_dict_value(key, value) elif hasattr(value, '__dict__'): self.write_non_parsable_object_value(key, value) else: From 1674c6659d95f3a661f254e6b6f7294fabee6035 Mon Sep 17 00:00:00 2001 From: Patrick Magee Date: Fri, 26 Jul 2024 11:05:33 +0100 Subject: [PATCH 057/105] Fix data loss with 'None' being returned incases where a JSON Parse node that contains a 'number' is not a true 'floating point number' with a 'decimal' but is a integer value, though still defined in the OpenAPI Spec as a number (which allows integers) and could potentially hint to the client if that's generally a float or double. In the case where no hint is provided to the client, I think the same behaviour should happen, a simple conversion from integer to float type in the Kiota side. Signed-off-by: Patrick Magee --- kiota_serialization_json/json_parse_node.py | 4 ++-- tests/unit/test_json_parse_node.py | 22 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index 2a2dd4f..1364f96 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -67,9 +67,9 @@ def get_int_value(self) -> Optional[int]: def get_float_value(self) -> Optional[float]: """Gets the float value of the json node Returns: - float: The integer value of the node + float: The number value of the node """ - return self._json_node if isinstance(self._json_node, float) else None + return float(self._json_node) if isinstance(self._json_node, (float, int)) else None def get_uuid_value(self) -> Optional[UUID]: """Gets the UUID value of the json node diff --git a/tests/unit/test_json_parse_node.py b/tests/unit/test_json_parse_node.py index d5c605a..8b6814f 100644 --- a/tests/unit/test_json_parse_node.py +++ b/tests/unit/test_json_parse_node.py @@ -28,12 +28,32 @@ def test_get_bool_value(): assert result is False -def test_get_float_value(): +def test_get_float_value_from_float(): + """ + This test is to ensure that the get_float_value method returns a float when the value is a float + """ parse_node = JsonParseNode(44.6) result = parse_node.get_float_value() + assert isinstance(result, float) assert result == 44.6 +@pytest.mark.parametrize("value", [0, 10, 100]) +def test_get_float_value(value: int): + """ + Consider an OpenAPI Specification using the type: number and format: float or double + Note: The OpenAPI Specification also allows for the use of the type: integer and format: int32 or int64 + + Consider an API with Price data [0, 0.5, 1, 1.5, 2] and so on + In this case, the contract must define the type as a number, with a hint of float or double as the format + + Kiota should be able to parse the response as a float, even if the value is an integer, because it's still a number. + """ + parse_node = JsonParseNode(value) + result = parse_node.get_float_value() + assert isinstance(result, float) + assert result == float(value) + def test_get_uuid_value(): parse_node = JsonParseNode("f58411c7-ae78-4d3c-bb0d-3f24d948de41") result = parse_node.get_uuid_value() From 0075e771c05d3b301344948f4dab83e950136db3 Mon Sep 17 00:00:00 2001 From: Patrick Magee Date: Fri, 26 Jul 2024 11:05:33 +0100 Subject: [PATCH 058/105] In the ISO 8601 date format (YYYY-MM-DD), the shortest possible valid date string is 10 characters long. Therefore, if the length of the string is less than 10, it cannot be a valid date in this format, and the function can immediately return None without attempting to parse the date, which would be a more expensive operation. --- kiota_serialization_json/json_parse_node.py | 4 ++++ tests/unit/test_json_parse_node.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index 2a2dd4f..9d1782b 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -89,7 +89,11 @@ def get_datetime_value(self) -> Optional[datetime]: """ if isinstance(self._json_node, datetime): return self._json_node + if isinstance(self._json_node, str): + if len(self._json_node) < 10: + return None + datetime_obj = pendulum.parse(self._json_node, exact=True) if isinstance(datetime_obj, pendulum.DateTime): return datetime_obj diff --git a/tests/unit/test_json_parse_node.py b/tests/unit/test_json_parse_node.py index d5c605a..f5e196c 100644 --- a/tests/unit/test_json_parse_node.py +++ b/tests/unit/test_json_parse_node.py @@ -39,6 +39,11 @@ def test_get_uuid_value(): result = parse_node.get_uuid_value() assert result == UUID("f58411c7-ae78-4d3c-bb0d-3f24d948de41") +@pytest.mark.parametrize("value", ["", " ", " ", "2022-01-0"]) +def test_get_datetime_value_returns_none_with_invalid_str(value: str): + parse_node = JsonParseNode(value) + result = parse_node.get_datetime_value() + assert result is None def test_get_datetime_value(): parse_node = JsonParseNode('2022-01-27T12:59:45.596117') From 742032aa0ffc61e3e3b997c0c56975e24b092268 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 26 Jul 2024 08:56:26 -0400 Subject: [PATCH 059/105] chore: linting fixes --- kiota_serialization_json/json_serialization_writer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kiota_serialization_json/json_serialization_writer.py b/kiota_serialization_json/json_serialization_writer.py index 338ddc7..b0a0926 100644 --- a/kiota_serialization_json/json_serialization_writer.py +++ b/kiota_serialization_json/json_serialization_writer.py @@ -256,10 +256,12 @@ def write_collection_of_enum_values( def __write_collection_of_dict_values( self, key: Optional[str], values: Optional[List[Dict[str, Any]]] ) -> None: - """Writes the specified collection of dictionary values to the stream with an optional given key. + """Writes the specified collection of dictionary values to the stream with an optional + given key. Args: key (Optional[str]): The key to be used for the written value. May be null. - values (Optional[List[Dict[str, Any]]]): The collection of dictionary values to be written. + values (Optional[List[Dict[str, Any]]]): The collection of dictionary values + to be written. """ if isinstance(values, list): result = [] From acf513b9691dde6c34cf3f1c721855cc742db3c9 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 26 Jul 2024 09:03:16 -0400 Subject: [PATCH 060/105] chore: adds changelog entry for date time fix --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 244cbe5..46f976f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.3.0] - 2024-07-26 ### Added + - Support `dict[str, Any]` and `list[dict[str, Any]]` when writing additional data. ### Changed +- Fixed a bug where date time deserialization would fail because of empty strings. + ## [1.2.0] - 2024-04-09 ### Added From 04220acb9e67a749a74262f3703cc638aae6c0f8 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 26 Jul 2024 09:06:32 -0400 Subject: [PATCH 061/105] chore: adds changelog entry for float fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46f976f..85cf7a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Fixed a bug where date time deserialization would fail because of empty strings. +- Fixed a bug where float deserialization if the number represented qualified as an int. ## [1.2.0] - 2024-04-09 From 408ebc9486f0db2c6cd8c37e595dc00ab25978fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 06:11:44 +0000 Subject: [PATCH 062/105] chore(deps-dev): bump mypy from 1.11.0 to 1.11.1 Bumps [mypy](https://github.com/python/mypy) from 1.11.0 to 1.11.1. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.11...v1.11.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e446e86..e03df4d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -28,7 +28,7 @@ lazy-object-proxy==1.10.0 mccabe==0.7.0 -mypy==1.11.0 +mypy==1.11.1 mypy-extensions==1.0.0 From e38011e036063a1639d1a3eb49373e493f81a47f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 06:35:20 +0000 Subject: [PATCH 063/105] chore(deps-dev): bump coverage[toml] from 7.6.0 to 7.6.1 Bumps [coverage[toml]](https://github.com/nedbat/coveragepy) from 7.6.0 to 7.6.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.6.0...7.6.1) --- updated-dependencies: - dependency-name: coverage[toml] dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e03df4d..f69a64d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ certifi==2024.7.4 charset-normalizer==3.3.2 -coverage[toml]==7.6.0 +coverage[toml]==7.6.1 dill==0.3.8 From 4c21593e5bb9837c426ee92c22ae0f34f68fe104 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 06:08:47 +0000 Subject: [PATCH 064/105] chore(deps-dev): bump zipp from 3.19.2 to 3.20.0 Bumps [zipp](https://github.com/jaraco/zipp) from 3.19.2 to 3.20.0. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.19.2...v3.20.0) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f69a64d..913babf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -62,7 +62,7 @@ wrapt==1.16.0 yapf==0.40.2 -zipp==3.19.2 ; python_version >= '3.8' +zipp==3.20.0 ; python_version >= '3.8' colorama==0.4.6 From 67f1c248e69c9b5c7332218de21fc19322e43d35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 06:31:55 +0000 Subject: [PATCH 065/105] chore(deps-dev): bump tomlkit from 0.13.0 to 0.13.1 Bumps [tomlkit](https://github.com/sdispater/tomlkit) from 0.13.0 to 0.13.1. - [Release notes](https://github.com/sdispater/tomlkit/releases) - [Changelog](https://github.com/python-poetry/tomlkit/blob/master/CHANGELOG.md) - [Commits](https://github.com/sdispater/tomlkit/compare/0.13.0...0.13.1) --- updated-dependencies: - dependency-name: tomlkit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 913babf..b9718e2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -50,7 +50,7 @@ toml==0.10.2 tomli==2.0.1 -tomlkit==0.13.0 +tomlkit==0.13.1 types-python-dateutil==2.9.0.20240316 From 1c69ba7ec5fe4f8ef03db819023c386db62cb24f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 06:29:57 +0000 Subject: [PATCH 066/105] chore(deps-dev): bump tomlkit from 0.13.1 to 0.13.2 Bumps [tomlkit](https://github.com/sdispater/tomlkit) from 0.13.1 to 0.13.2. - [Release notes](https://github.com/sdispater/tomlkit/releases) - [Changelog](https://github.com/python-poetry/tomlkit/blob/master/CHANGELOG.md) - [Commits](https://github.com/sdispater/tomlkit/compare/0.13.1...0.13.2) --- updated-dependencies: - dependency-name: tomlkit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b9718e2..5ccef50 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -50,7 +50,7 @@ toml==0.10.2 tomli==2.0.1 -tomlkit==0.13.1 +tomlkit==0.13.2 types-python-dateutil==2.9.0.20240316 From 99443c7e2f96a0974cadedcde89d8fda188f4186 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 06:55:20 +0000 Subject: [PATCH 067/105] chore(deps-dev): bump types-python-dateutil Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.9.0.20240316 to 2.9.0.20240821. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5ccef50..36823cd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -52,7 +52,7 @@ tomli==2.0.1 tomlkit==0.13.2 -types-python-dateutil==2.9.0.20240316 +types-python-dateutil==2.9.0.20240821 typing-extensions==4.12.2 From 987f2e8858231352505e22e0250ecb37af624a95 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Fri, 23 Aug 2024 19:40:22 +0300 Subject: [PATCH 068/105] Add regex to be skipped by pendulum when converting strings to dates --- kiota_serialization_json/json_parse_node.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index d1e6751..13b5efc 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -8,6 +8,8 @@ from uuid import UUID import pendulum +import re + from kiota_abstractions.serialization import Parsable, ParsableFactory, ParseNode T = TypeVar("T") @@ -287,6 +289,10 @@ def _assign_field_values(self, item: U) -> None: deserialize but the model doesn't support additional data" ) + def is_four_digit_number(self, value: str) -> bool: + pattern = r'^\d{4}$' + return bool(re.match(pattern, value)) + def try_get_anything(self, value: Any) -> Any: if isinstance(value, (int, float, bool)) or value is None: return value From da59b3483222f42928bb8afcbfa3082528657f50 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Fri, 23 Aug 2024 19:43:31 +0300 Subject: [PATCH 069/105] integrate regex to bypass pendulum bug where pendulum assumes 4 digit strings are datetime objects --- kiota_serialization_json/json_parse_node.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index 13b5efc..e60fa02 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -302,10 +302,14 @@ def try_get_anything(self, value: Any) -> Any: return dict(map(lambda x: (x[0], self.try_get_anything(x[1])), value.items())) if isinstance(value, str): try: - datetime_obj = pendulum.parse(value) - if isinstance(datetime_obj, pendulum.Duration): - return datetime_obj.as_timedelta() - return datetime_obj + if self.is_four_digit_number(value): + print(value) + return value + else: + datetime_obj = pendulum.parse(value) + if isinstance(datetime_obj, pendulum.Duration): + return datetime_obj.as_timedelta() + return datetime_obj except ValueError: pass try: From 96b4615bc82fe2c2707480a18b6af8c2322d35e5 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Fri, 23 Aug 2024 20:01:00 +0300 Subject: [PATCH 070/105] fix code format --- kiota_serialization_json/json_parse_node.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index e60fa02..3242072 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -305,11 +305,11 @@ def try_get_anything(self, value: Any) -> Any: if self.is_four_digit_number(value): print(value) return value - else: - datetime_obj = pendulum.parse(value) - if isinstance(datetime_obj, pendulum.Duration): - return datetime_obj.as_timedelta() - return datetime_obj + + datetime_obj = pendulum.parse(value) + if isinstance(datetime_obj, pendulum.Duration): + return datetime_obj.as_timedelta() + return datetime_obj except ValueError: pass try: From 8eef3e6accdcf5b18cd837b0d912d05990f9dab8 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Fri, 23 Aug 2024 20:05:46 +0300 Subject: [PATCH 071/105] fix conflicts --- kiota_serialization_json/json_parse_node.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index 4366285..c60dcd8 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -309,12 +309,12 @@ def try_get_anything(self, value: Any) -> Any: if self.is_four_digit_number(value): print(value) return value - else: - datetime_obj = pendulum.parse(value) - if isinstance(datetime_obj, pendulum.Duration): - return datetime_obj.as_timedelta() - return datetime_obj - except: + + datetime_obj = pendulum.parse(value) + if isinstance(datetime_obj, pendulum.Duration): + return datetime_obj.as_timedelta() + return datetime_obj + except ValueError: pass try: return UUID(value) From 626f2e324473e1647d673bfd859c4b65de705de4 Mon Sep 17 00:00:00 2001 From: Shem Ogumbe Date: Fri, 23 Aug 2024 20:24:41 +0300 Subject: [PATCH 072/105] Update kiota_serialization_json/json_parse_node.py Co-authored-by: Vincent Biret --- kiota_serialization_json/json_parse_node.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index c60dcd8..deb4994 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -307,7 +307,6 @@ def try_get_anything(self, value: Any) -> Any: if isinstance(value, str): try: if self.is_four_digit_number(value): - print(value) return value datetime_obj = pendulum.parse(value) From 1b81019639146a287ce3d459d469234e80ef1fd9 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Fri, 23 Aug 2024 20:25:19 +0300 Subject: [PATCH 073/105] updated change log and version --- CHANGELOG.md | 8 ++++++++ kiota_serialization_json/_version.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85cf7a3..6cf3880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.4.0] - 2024-08-23 + +### Added + +- Fixed 4-digit numeric strings from being parsed as Datetime objects to being parsed as strings. + + ## [1.3.0] - 2024-07-26 ### Added diff --git a/kiota_serialization_json/_version.py b/kiota_serialization_json/_version.py index 3810552..4b74830 100644 --- a/kiota_serialization_json/_version.py +++ b/kiota_serialization_json/_version.py @@ -1 +1 @@ -VERSION: str = '1.3.0' +VERSION: str = '1.4.0' From 5f8b03acd90cc4dfbf4084273dbc30fe332a6fce Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Fri, 23 Aug 2024 20:42:01 +0300 Subject: [PATCH 074/105] Added unit tests to fix --- tests/unit/test_json_parse_node.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/unit/test_json_parse_node.py b/tests/unit/test_json_parse_node.py index b50e7e4..7bec942 100644 --- a/tests/unit/test_json_parse_node.py +++ b/tests/unit/test_json_parse_node.py @@ -1,6 +1,7 @@ import json from datetime import date, datetime, time, timedelta from uuid import UUID +import pendulum import pytest from pendulum import DateTime, FixedTimezone @@ -54,17 +55,20 @@ def test_get_float_value(value: int): assert isinstance(result, float) assert result == float(value) + def test_get_uuid_value(): parse_node = JsonParseNode("f58411c7-ae78-4d3c-bb0d-3f24d948de41") result = parse_node.get_uuid_value() assert result == UUID("f58411c7-ae78-4d3c-bb0d-3f24d948de41") + @pytest.mark.parametrize("value", ["", " ", " ", "2022-01-0"]) def test_get_datetime_value_returns_none_with_invalid_str(value: str): parse_node = JsonParseNode(value) result = parse_node.get_datetime_value() assert result is None + def test_get_datetime_value(): parse_node = JsonParseNode('2022-01-27T12:59:45.596117') result = parse_node.get_datetime_value() @@ -130,6 +134,20 @@ def test_get_enum_value_for_key_not_found(): assert result is None +def test_get_anythin_does_not_convert_numeric_chars_to_datetime(): + parse_node = JsonParseNode("1212") + result = parse_node.try_get_anything("1212") + assert isinstance(result, str) + assert result == "1212" + + +def test_get_anythin_does_convert_date_string_to_datetime(): + parse_node = JsonParseNode("2023-10-05T14:48:00.000Z") + result = parse_node.try_get_anything("2023-10-05T14:48:00.000Z") + assert isinstance(result, pendulum.DateTime) + assert result == pendulum.parse("2023-10-05T14:48:00.000Z") + + def test_get_object_value(user1_json): parse_node = JsonParseNode(json.loads(user1_json)) result = parse_node.get_object_value(User) From 27e639ace6aac2a371c9c6f19553f90263f27e46 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Fri, 23 Aug 2024 20:47:11 +0300 Subject: [PATCH 075/105] correct version number --- CHANGELOG.md | 2 +- kiota_serialization_json/_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cf3880..fb6a78f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.4.0] - 2024-08-23 +## [1.3.1] - 2024-08-23 ### Added diff --git a/kiota_serialization_json/_version.py b/kiota_serialization_json/_version.py index 4b74830..d045b44 100644 --- a/kiota_serialization_json/_version.py +++ b/kiota_serialization_json/_version.py @@ -1 +1 @@ -VERSION: str = '1.4.0' +VERSION: str = '1.3.1' From 3298ab68de30614a752992da5fa4b2378684f5f4 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 23 Aug 2024 14:43:49 -0400 Subject: [PATCH 076/105] fix: makes method private --- kiota_serialization_json/json_parse_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index deb4994..ac3252e 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -293,7 +293,7 @@ def _assign_field_values(self, item: U) -> None: deserialize but the model doesn't support additional data" ) - def is_four_digit_number(self, value: str) -> bool: + def __is_four_digit_number(self, value: str) -> bool: pattern = r'^\d{4}$' return bool(re.match(pattern, value)) @@ -306,7 +306,7 @@ def try_get_anything(self, value: Any) -> Any: return dict(map(lambda x: (x[0], self.try_get_anything(x[1])), value.items())) if isinstance(value, str): try: - if self.is_four_digit_number(value): + if self.__is_four_digit_number(value): return value datetime_obj = pendulum.parse(value) From 6f43aab5dfdb639dbd1d3c20e969c866062e6331 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 06:55:51 +0000 Subject: [PATCH 077/105] chore(deps-dev): bump mypy from 1.11.1 to 1.11.2 Bumps [mypy](https://github.com/python/mypy) from 1.11.1 to 1.11.2. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.11.1...v1.11.2) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 36823cd..c2cf477 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -28,7 +28,7 @@ lazy-object-proxy==1.10.0 mccabe==0.7.0 -mypy==1.11.1 +mypy==1.11.2 mypy-extensions==1.0.0 From dbd551a3a3950b072fbd3e3449f7a402727271ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 06:55:56 +0000 Subject: [PATCH 078/105] chore(deps-dev): bump idna from 3.7 to 3.8 Bumps [idna](https://github.com/kjd/idna) from 3.7 to 3.8. - [Release notes](https://github.com/kjd/idna/releases) - [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst) - [Commits](https://github.com/kjd/idna/compare/v3.7...v3.8) --- updated-dependencies: - dependency-name: idna dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 36823cd..8faa20a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,7 +16,7 @@ flit==3.9.0 flit-core==3.9.0 -idna==3.7 +idna==3.8 importlib-metadata==6.8.0 ; python_version >= '3.8' From be81711879f821ff2add82eda819c14992e5182f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 06:59:19 +0000 Subject: [PATCH 079/105] chore(deps-dev): bump zipp from 3.20.0 to 3.20.1 Bumps [zipp](https://github.com/jaraco/zipp) from 3.20.0 to 3.20.1. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.20.0...v3.20.1) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index cdaf078..9d78472 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -62,7 +62,7 @@ wrapt==1.16.0 yapf==0.40.2 -zipp==3.20.0 ; python_version >= '3.8' +zipp==3.20.1 ; python_version >= '3.8' colorama==0.4.6 From 7295611637240f9fcc98ea38e90a699846278af8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 06:04:50 +0000 Subject: [PATCH 080/105] chore(deps-dev): bump certifi from 2024.7.4 to 2024.8.30 Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.7.4 to 2024.8.30. - [Commits](https://github.com/certifi/python-certifi/compare/2024.07.04...2024.08.30) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9d78472..e775cb0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ astroid==3.2.4 -certifi==2024.7.4 +certifi==2024.8.30 charset-normalizer==3.3.2 From 7e40315d15fcd265d7cc9026d65ecabbdaeba3ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 07:02:53 +0000 Subject: [PATCH 081/105] chore(deps-dev): bump pylint from 3.2.6 to 3.2.7 in the pylint group Bumps the pylint group with 1 update: [pylint](https://github.com/pylint-dev/pylint). Updates `pylint` from 3.2.6 to 3.2.7 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.6...v3.2.7) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pylint ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e775cb0..79b2f3f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -38,7 +38,7 @@ platformdirs==4.2.2 pluggy==1.5.0 -pylint==3.2.6 +pylint==3.2.7 pytest==8.3.2 From 9dd420ec8e8f675453a883dd51d03bb88e4980d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 06:19:31 +0000 Subject: [PATCH 082/105] chore(deps-dev): bump types-python-dateutil Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.9.0.20240821 to 2.9.0.20240906. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 79b2f3f..b8286d6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -52,7 +52,7 @@ tomli==2.0.1 tomlkit==0.13.2 -types-python-dateutil==2.9.0.20240821 +types-python-dateutil==2.9.0.20240906 typing-extensions==4.12.2 From 5d60ea96d5d55eaf3778d5adcf99465aa7fa025b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 06:14:47 +0000 Subject: [PATCH 083/105] chore(deps-dev): bump platformdirs from 4.2.2 to 4.3.2 Bumps [platformdirs](https://github.com/platformdirs/platformdirs) from 4.2.2 to 4.3.2. - [Release notes](https://github.com/platformdirs/platformdirs/releases) - [Changelog](https://github.com/tox-dev/platformdirs/blob/main/CHANGES.rst) - [Commits](https://github.com/platformdirs/platformdirs/compare/4.2.2...4.3.2) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b8286d6..d0fb738 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mypy-extensions==1.0.0 packaging==24.1 -platformdirs==4.2.2 +platformdirs==4.3.2 pluggy==1.5.0 From 6714ba8b3c48d70d7610801e6ed3077a3298949e Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 10 Sep 2024 12:47:07 +0300 Subject: [PATCH 084/105] remove is four digit number check --- kiota_serialization_json/json_parse_node.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index ac3252e..ad7b09c 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -293,10 +293,6 @@ def _assign_field_values(self, item: U) -> None: deserialize but the model doesn't support additional data" ) - def __is_four_digit_number(self, value: str) -> bool: - pattern = r'^\d{4}$' - return bool(re.match(pattern, value)) - def try_get_anything(self, value: Any) -> Any: if isinstance(value, (int, float, bool)) or value is None: return value @@ -306,8 +302,6 @@ def try_get_anything(self, value: Any) -> Any: return dict(map(lambda x: (x[0], self.try_get_anything(x[1])), value.items())) if isinstance(value, str): try: - if self.__is_four_digit_number(value): - return value datetime_obj = pendulum.parse(value) if isinstance(datetime_obj, pendulum.Duration): From 6544b52d3e78e28db6c7036c65423906fd8e22c5 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 10 Sep 2024 12:50:54 +0300 Subject: [PATCH 085/105] add check for isdidgit --- kiota_serialization_json/json_parse_node.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kiota_serialization_json/json_parse_node.py b/kiota_serialization_json/json_parse_node.py index ad7b09c..937ccd3 100644 --- a/kiota_serialization_json/json_parse_node.py +++ b/kiota_serialization_json/json_parse_node.py @@ -302,7 +302,8 @@ def try_get_anything(self, value: Any) -> Any: return dict(map(lambda x: (x[0], self.try_get_anything(x[1])), value.items())) if isinstance(value, str): try: - + if value.isdigit(): + return value datetime_obj = pendulum.parse(value) if isinstance(datetime_obj, pendulum.Duration): return datetime_obj.as_timedelta() From 083a173f5a0f4a7998bbe9feea0c98fc68856c10 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 10 Sep 2024 13:00:26 +0300 Subject: [PATCH 086/105] add unit tests --- tests/unit/test_json_parse_node.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/unit/test_json_parse_node.py b/tests/unit/test_json_parse_node.py index 7bec942..cf1e003 100644 --- a/tests/unit/test_json_parse_node.py +++ b/tests/unit/test_json_parse_node.py @@ -141,6 +141,25 @@ def test_get_anythin_does_not_convert_numeric_chars_to_datetime(): assert result == "1212" +def test_get_anythin_does_not_convert_any_length_numeric_chars_to_datetime(): + parse_node = JsonParseNode("1212") + result1 = parse_node.try_get_anything("1212") + parse_node_two = JsonParseNode("-PT15M") + result2 = parse_node_two.try_get_anything("-PT15M") + parse_node_three = JsonParseNode("20081008") + result3 = parse_node_three.try_get_anything("20081008") + parse_node_four = JsonParseNode("1011317") + result4 = parse_node_four.try_get_anything("1011317") + assert isinstance(result1, str) + assert result1 == "1212" + assert isinstance(result2, str) + assert result2 == "-PT15M" + assert isinstance(result3, str) + assert result3 == "20081008" + assert isinstance(result4, str) + assert result4 == "1011317" + + def test_get_anythin_does_convert_date_string_to_datetime(): parse_node = JsonParseNode("2023-10-05T14:48:00.000Z") result = parse_node.try_get_anything("2023-10-05T14:48:00.000Z") From 7683982134e981ff5b45027c8d37d148cd0de869 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 10 Sep 2024 13:03:49 +0300 Subject: [PATCH 087/105] update version and changelog --- CHANGELOG.md | 8 ++++++++ kiota_serialization_json/_version.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6a78f..6186cbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.2] - 2024-09-10 + +### Added + +- Fixed numeric strings from being parsed as Datetime objects to being parsed as strings. +-Only parse to Datetime objects that conform to ISO 8601 format. + + ## [1.3.1] - 2024-08-23 diff --git a/kiota_serialization_json/_version.py b/kiota_serialization_json/_version.py index d045b44..b84f08f 100644 --- a/kiota_serialization_json/_version.py +++ b/kiota_serialization_json/_version.py @@ -1 +1 @@ -VERSION: str = '1.3.1' +VERSION: str = '1.3.2' From 7bf86b3e29ff7c380c3e3e03f5b204f00c25bb7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 06:34:51 +0000 Subject: [PATCH 088/105] chore(deps-dev): bump pytest from 8.3.2 to 8.3.3 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.2 to 8.3.3. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d0fb738..7d0509a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -40,7 +40,7 @@ pluggy==1.5.0 pylint==3.2.7 -pytest==8.3.2 +pytest==8.3.3 pytest-cov==5.0.0 From 00bbf44f285c949e4ba3eafbd43c53d184c28321 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 06:25:55 +0000 Subject: [PATCH 089/105] chore(deps-dev): bump urllib3 from 2.2.2 to 2.2.3 Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.2.3. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.2.2...2.2.3) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7d0509a..e7b4b90 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -56,7 +56,7 @@ types-python-dateutil==2.9.0.20240906 typing-extensions==4.12.2 -urllib3==2.2.2 +urllib3==2.2.3 wrapt==1.16.0 From cc6e1ef8c0ffb1250e3d2ae64b6c37d6b34a462d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 06:45:54 +0000 Subject: [PATCH 090/105] chore(deps-dev): bump platformdirs from 4.3.2 to 4.3.3 Bumps [platformdirs](https://github.com/tox-dev/platformdirs) from 4.3.2 to 4.3.3. - [Release notes](https://github.com/tox-dev/platformdirs/releases) - [Changelog](https://github.com/tox-dev/platformdirs/blob/main/CHANGES.rst) - [Commits](https://github.com/tox-dev/platformdirs/compare/4.3.2...4.3.3) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e7b4b90..6bc0fe2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mypy-extensions==1.0.0 packaging==24.1 -platformdirs==4.3.2 +platformdirs==4.3.3 pluggy==1.5.0 From d48be23f5e5b905db6f6c18e65cdbf6b023c48a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 06:45:58 +0000 Subject: [PATCH 091/105] chore(deps-dev): bump zipp from 3.20.1 to 3.20.2 Bumps [zipp](https://github.com/jaraco/zipp) from 3.20.1 to 3.20.2. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.20.1...v3.20.2) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e7b4b90..c37468e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -62,7 +62,7 @@ wrapt==1.16.0 yapf==0.40.2 -zipp==3.20.1 ; python_version >= '3.8' +zipp==3.20.2 ; python_version >= '3.8' colorama==0.4.6 From d05a0bfd645f0ba649a7060f35bd572bc67107d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 06:46:01 +0000 Subject: [PATCH 092/105] chore(deps-dev): bump idna from 3.8 to 3.10 Bumps [idna](https://github.com/kjd/idna) from 3.8 to 3.10. - [Release notes](https://github.com/kjd/idna/releases) - [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst) - [Commits](https://github.com/kjd/idna/compare/v3.8...v3.10) --- updated-dependencies: - dependency-name: idna dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e7b4b90..e208c2b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,7 +16,7 @@ flit==3.9.0 flit-core==3.9.0 -idna==3.8 +idna==3.10 importlib-metadata==6.8.0 ; python_version >= '3.8' From f5d213116ade52372e8756169a2ab1fc14198fa2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 06:40:11 +0000 Subject: [PATCH 093/105] chore(deps-dev): bump platformdirs from 4.3.3 to 4.3.6 Bumps [platformdirs](https://github.com/tox-dev/platformdirs) from 4.3.3 to 4.3.6. - [Release notes](https://github.com/tox-dev/platformdirs/releases) - [Changelog](https://github.com/tox-dev/platformdirs/blob/main/CHANGES.rst) - [Commits](https://github.com/tox-dev/platformdirs/compare/4.3.3...4.3.6) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 68a40dd..27852f2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,7 +34,7 @@ mypy-extensions==1.0.0 packaging==24.1 -platformdirs==4.3.3 +platformdirs==4.3.6 pluggy==1.5.0 From 3278fe8619bc63ddfc9d6808c4555ec3c9b53a6c Mon Sep 17 00:00:00 2001 From: eranavrahami Date: Tue, 24 Sep 2024 18:04:38 +0300 Subject: [PATCH 094/105] fix serialization of pendulum.DateTime objects in JsonSerializationWriter --- .../json_serialization_writer.py | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/kiota_serialization_json/json_serialization_writer.py b/kiota_serialization_json/json_serialization_writer.py index b0a0926..48d90a7 100644 --- a/kiota_serialization_json/json_serialization_writer.py +++ b/kiota_serialization_json/json_serialization_writer.py @@ -16,7 +16,6 @@ class JsonSerializationWriter(SerializationWriter): - PROPERTY_SEPARATOR: str = ',' def __init__(self) -> None: @@ -24,7 +23,7 @@ def __init__(self) -> None: self.value: Any = None self._on_start_object_serialization: Optional[Callable[[Parsable, SerializationWriter], - None]] = None + None]] = None self._on_before_object_serialization: Optional[Callable[[Parsable], None]] = None self._on_after_object_serialization: Optional[Callable[[Parsable], None]] = None @@ -192,7 +191,7 @@ def write_time_value(self, key: Optional[str], value: Optional[time]) -> None: raise ValueError("Invalid time string value found") def write_collection_of_primitive_values( - self, key: Optional[str], values: Optional[List[T]] + self, key: Optional[str], values: Optional[List[T]] ) -> None: """Writes the specified collection of primitive values to the stream with an optional given key. @@ -213,7 +212,7 @@ def write_collection_of_primitive_values( self.value = result def write_collection_of_object_values( - self, key: Optional[str], values: Optional[List[U]] + self, key: Optional[str], values: Optional[List[U]] ) -> None: """Writes the specified collection of model objects to the stream with an optional given key. @@ -234,7 +233,7 @@ def write_collection_of_object_values( self.value = obj_list def write_collection_of_enum_values( - self, key: Optional[str], values: Optional[List[Enum]] + self, key: Optional[str], values: Optional[List[Enum]] ) -> None: """Writes the specified collection of enum values to the stream with an optional given key. Args: @@ -254,7 +253,7 @@ def write_collection_of_enum_values( self.value = result def __write_collection_of_dict_values( - self, key: Optional[str], values: Optional[List[Dict[str, Any]]] + self, key: Optional[str], values: Optional[List[Dict[str, Any]]] ) -> None: """Writes the specified collection of dictionary values to the stream with an optional given key. @@ -291,7 +290,7 @@ def write_bytes_value(self, key: Optional[str], value: bytes) -> None: self.value = base64_string def write_object_value( - self, key: Optional[str], value: Optional[U], *additional_values_to_merge: U + self, key: Optional[str], value: Optional[U], *additional_values_to_merge: U ) -> None: """Writes the specified model object to the stream with an optional given key. Args: @@ -424,7 +423,7 @@ def on_after_object_serialization(self, value: Optional[Callable[[Parsable], Non @property def on_start_object_serialization( - self + self ) -> Optional[Callable[[Parsable, SerializationWriter], None]]: """Gets the callback called right after the serialization process starts. Returns: @@ -435,7 +434,7 @@ def on_start_object_serialization( @on_start_object_serialization.setter def on_start_object_serialization( - self, value: Optional[Callable[[Parsable, SerializationWriter], None]] + self, value: Optional[Callable[[Parsable, SerializationWriter], None]] ) -> None: """Sets the callback called right after the serialization process starts. Args: @@ -458,16 +457,13 @@ def write_non_parsable_object_value(self, key: Optional[str], value: T) -> None: def write_any_value(self, key: Optional[str], value: Any) -> Any: """Writes the specified value to the stream with an optional given key. + Args: key (Optional[str]): The key to be used for the written value. May be null. - value Any): The value to be written. + value (Any): The value to be written. """ - value_type = type(value) if value is None: self.write_null_value(key) - elif value_type in PRIMITIVE_TYPES: - method = getattr(self, f'write_{value_type.__name__.lower()}_value') - method(key, value) elif isinstance(value, Parsable): self.write_object_value(key, value) elif isinstance(value, list): @@ -475,24 +471,28 @@ def write_any_value(self, key: Optional[str], value: Any) -> Any: self.write_collection_of_object_values(key, value) elif all(isinstance(x, Enum) for x in value): self.write_collection_of_enum_values(key, value) - elif all((type(x) in PRIMITIVE_TYPES) for x in value): + elif all(any(isinstance(x, primitive_type) for primitive_type in PRIMITIVE_TYPES) for x in value): self.write_collection_of_primitive_values(key, value) elif all(isinstance(x, dict) for x in value): self.__write_collection_of_dict_values(key, value) else: raise TypeError( - f"Encountered an unknown collection type during serialization \ - {value_type} with key {key}" + f"Encountered an unknown collection type during serialization {type(value)} with key {key}" ) elif isinstance(value, dict): self.__write_dict_value(key, value) - elif hasattr(value, '__dict__'): - self.write_non_parsable_object_value(key, value) else: - raise TypeError( - f"Encountered an unknown type during serialization {value_type} \ - with key {key}" - ) + for primitive_type in PRIMITIVE_TYPES: + if isinstance(value, primitive_type): + method = getattr(self, f"write_{primitive_type.__name__.lower()}_value") + method(key, value) + return + if hasattr(value, "__dict__"): + self.write_non_parsable_object_value(key, value) + else: + raise TypeError( + f"Encountered an unknown type during serialization {type(value)} with key {key}" + ) def _serialize_value(self, temp_writer: JsonSerializationWriter, value: U): if on_before := self.on_before_object_serialization: From 7599c1fee5b6c9787cd8c2a281312caa5c21c78e Mon Sep 17 00:00:00 2001 From: eranavrahami Date: Tue, 24 Sep 2024 19:06:30 +0300 Subject: [PATCH 095/105] add pendulum testcase to test_write_additional_data_value --- tests/unit/test_json_serialization_writer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_json_serialization_writer.py b/tests/unit/test_json_serialization_writer.py index 02ce3f6..36261b9 100644 --- a/tests/unit/test_json_serialization_writer.py +++ b/tests/unit/test_json_serialization_writer.py @@ -255,6 +255,7 @@ def test_write_additional_data_value(user_1, user_2): "manager": user_1, "approvers": [user_1, user_2], "created_at": date(2022, 1, 27), + "updated_at": pendulum.DateTime(2024, 9, 24), "data": { "groups": [{ "friends": [user_2] @@ -271,5 +272,7 @@ def test_write_additional_data_value(user_1, user_2): '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ '"approvers": [{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ - '{"display_name": "John Doe", "age": 32}], "created_at": "2022-01-27", '\ - '"data": {"groups": [{"friends": [{"display_name": "John Doe", "age": 32}]}]}}' + '{"display_name": "John Doe", "age": 32}], '\ + '"created_at": "2022-01-27", '\ + '"updated_at": "2024-09-24T00:00:00", '\ + '"data": {"groups": [{"friends": [{"display_name": "John Doe", "age": 32}]}]}}' From dc563deee6055e762fe172fee4e40ead5e49a0b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 06:17:33 +0000 Subject: [PATCH 096/105] chore(deps-dev): bump dill from 0.3.8 to 0.3.9 Bumps [dill](https://github.com/uqfoundation/dill) from 0.3.8 to 0.3.9. - [Release notes](https://github.com/uqfoundation/dill/releases) - [Commits](https://github.com/uqfoundation/dill/compare/0.3.8...0.3.9) --- updated-dependencies: - dependency-name: dill dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 27852f2..0b154e0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ charset-normalizer==3.3.2 coverage[toml]==7.6.1 -dill==0.3.8 +dill==0.3.9 docutils==0.20.1 From 0187bd080d1e112717716f2fcdea24d5f57f459c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 06:33:42 +0000 Subject: [PATCH 097/105] chore(deps-dev): bump types-python-dateutil Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.9.0.20240906 to 2.9.0.20241003. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0b154e0..ff7ae58 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -52,7 +52,7 @@ tomli==2.0.1 tomlkit==0.13.2 -types-python-dateutil==2.9.0.20240906 +types-python-dateutil==2.9.0.20241003 typing-extensions==4.12.2 From 41b274fccdee404f450a7b8ac68cd5fe109bde01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 06:33:45 +0000 Subject: [PATCH 098/105] chore(deps-dev): bump tomli from 2.0.1 to 2.0.2 Bumps [tomli](https://github.com/hukkin/tomli) from 2.0.1 to 2.0.2. - [Changelog](https://github.com/hukkin/tomli/blob/master/CHANGELOG.md) - [Commits](https://github.com/hukkin/tomli/compare/2.0.1...2.0.2) --- updated-dependencies: - dependency-name: tomli dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0b154e0..4e43d39 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -48,7 +48,7 @@ requests==2.32.3 toml==0.10.2 -tomli==2.0.1 +tomli==2.0.2 tomlkit==0.13.2 From 27fa1932ccbe013a4d5b9878c21690ab0fe4e4fc Mon Sep 17 00:00:00 2001 From: eranavrahami Date: Thu, 3 Oct 2024 18:33:52 +0300 Subject: [PATCH 099/105] bump version and update changelog.md --- CHANGELOG.md | 25 ++++++++++++++++++------- kiota_serialization_json/_version.py | 2 +- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6186cbb..4bd64b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,17 +2,21 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.3.2] - 2024-09-10 +## [1.3.3] - 2024-10-03 -### Added +### Fixed -- Fixed numeric strings from being parsed as Datetime objects to being parsed as strings. --Only parse to Datetime objects that conform to ISO 8601 format. +- Fixed an issue where `pendulum.DateTime` objects were not properly serialized by `JsonSerializationWriter`. Now, `pendulum.DateTime` objects are correctly recognized as subclasses of `datetime.datetime` and serialized accordingly. + +## [1.3.2] - 2024-09-10 +### Added +- Fixed numeric strings from being parsed as Datetime objects to being parsed as strings. +- Only parse to Datetime objects that conform to ISO 8601 format. ## [1.3.1] - 2024-08-23 @@ -20,7 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed 4-digit numeric strings from being parsed as Datetime objects to being parsed as strings. - ## [1.3.0] - 2024-07-26 ### Added @@ -37,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Enhanced error handling: Enabled silent failure when an enum key is not available ## [1.1.0] - 2024-02-29 @@ -44,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Support objects and collections when writing additional data. ## [1.0.1] - 2023-12-16 @@ -51,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Bump pendulum to v3.0.0b1 for python 3.12 support. ## [1.0.0] - 2023-10-31 @@ -58,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - GA release ## [0.4.2] - 2023-10-11 @@ -65,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Switched from python-dateutil to pendulum for parsing datetime types. ## [0.4.1] - 2023-09-21 @@ -72,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Allow passing of valid strings as values for datetime and UUID fields. ## [0.4.0] - 2023-07-27 @@ -79,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Enabled backing store support ## [0.3.7] - 2023-07-04 @@ -86,6 +96,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Fixes the key assignment to the writer in write_bytes_value. ## [0.3.6] - 2023-06-27 @@ -93,6 +104,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Fixed a bug with loading json response in method to get root parse node. ## [0.3.5] - 2023-06-14 @@ -153,4 +165,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Fixed a bug with deserializing 'None' string values in enums. - diff --git a/kiota_serialization_json/_version.py b/kiota_serialization_json/_version.py index b84f08f..9ca2418 100644 --- a/kiota_serialization_json/_version.py +++ b/kiota_serialization_json/_version.py @@ -1 +1 @@ -VERSION: str = '1.3.2' +VERSION: str = '1.3.3' From 6ab9150cb64b74b3361ba7c7911dec4ec467319c Mon Sep 17 00:00:00 2001 From: eranavrahami Date: Thu, 3 Oct 2024 18:51:55 +0300 Subject: [PATCH 100/105] reformat --- .../json_serialization_writer.py | 37 ++++---- tests/unit/test_json_serialization_writer.py | 88 +++++++++++++------ 2 files changed, 79 insertions(+), 46 deletions(-) diff --git a/kiota_serialization_json/json_serialization_writer.py b/kiota_serialization_json/json_serialization_writer.py index 48d90a7..a585822 100644 --- a/kiota_serialization_json/json_serialization_writer.py +++ b/kiota_serialization_json/json_serialization_writer.py @@ -23,7 +23,7 @@ def __init__(self) -> None: self.value: Any = None self._on_start_object_serialization: Optional[Callable[[Parsable, SerializationWriter], - None]] = None + None]] = None self._on_before_object_serialization: Optional[Callable[[Parsable], None]] = None self._on_after_object_serialization: Optional[Callable[[Parsable], None]] = None @@ -79,7 +79,7 @@ def write_uuid_value(self, key: Optional[str], value: Optional[UUID]) -> None: """Writes the specified uuid value to the stream with an optional given key. Args: key (Optional[str]): The key to be used for the written value. May be null. - value (Optional[UUId]): The uuid value to be written. + value (Optional[UUID]): The uuid value to be written. """ if isinstance(value, UUID): if key: @@ -106,9 +106,9 @@ def write_datetime_value(self, key: Optional[str], value: Optional[datetime]) -> """ if isinstance(value, datetime): if key: - self.writer[key] = str(value.isoformat()) + self.writer[key] = value.isoformat() else: - self.value = str(value.isoformat()) + self.value = value.isoformat() elif isinstance(value, str): try: pendulum.parse(value) @@ -238,7 +238,7 @@ def write_collection_of_enum_values( """Writes the specified collection of enum values to the stream with an optional given key. Args: key (Optional[str]): The key to be used for the written value. May be null. - values Optional[List[Enum]): The enum values to be written. + values (Optional[List[Enum]]): The enum values to be written. """ if isinstance(values, list): result = [] @@ -359,7 +359,7 @@ def __write_dict_value(self, key: Optional[str], value: Dict[str, Any]) -> None: def write_additional_data_value(self, value: Dict[str, Any]) -> None: """Writes the specified additional data to the stream. Args: - value (Dict[str, Any]): he additional data to be written. + value (Dict[str, Any]): The additional data to be written. """ if isinstance(value, dict): for key, val in value.items(): @@ -389,17 +389,17 @@ def get_serialized_content(self) -> bytes: def on_before_object_serialization(self) -> Optional[Callable[[Parsable], None]]: """Gets the callback called before the object gets serialized. Returns: - Optional[Callable[[Parsable], None]]:the callback called before the object + Optional[Callable[[Parsable], None]]: The callback called before the object gets serialized. """ return self._on_before_object_serialization @on_before_object_serialization.setter def on_before_object_serialization(self, value: Optional[Callable[[Parsable], None]]) -> None: - """Sets the callback called before the objects gets serialized. + """Sets the callback called before the objects get serialized. Args: - value (Optional[Callable[[Parsable], None]]): the callback called before the objects - gets serialized. + value (Optional[Callable[[Parsable], None]]): The callback called before the objects + get serialized. """ self._on_before_object_serialization = value @@ -407,17 +407,17 @@ def on_before_object_serialization(self, value: Optional[Callable[[Parsable], No def on_after_object_serialization(self) -> Optional[Callable[[Parsable], None]]: """Gets the callback called after the object gets serialized. Returns: - Optional[Optional[Callable[[Parsable], None]]]: the callback called after the object + Optional[Callable[[Parsable], None]]: The callback called after the object gets serialized. """ return self._on_after_object_serialization @on_after_object_serialization.setter def on_after_object_serialization(self, value: Optional[Callable[[Parsable], None]]) -> None: - """Sets the callback called after the objects gets serialized. + """Sets the callback called after the objects get serialized. Args: - value (Optional[Callable[[Parsable], None]]): the callback called after the objects - gets serialized. + value (Optional[Callable[[Parsable], None]]): The callback called after the objects + get serialized. """ self._on_after_object_serialization = value @@ -427,7 +427,7 @@ def on_start_object_serialization( ) -> Optional[Callable[[Parsable, SerializationWriter], None]]: """Gets the callback called right after the serialization process starts. Returns: - Optional[Callable[[Parsable, SerializationWriter], None]]: the callback called + Optional[Callable[[Parsable, SerializationWriter], None]]: The callback called right after the serialization process starts. """ return self._on_start_object_serialization @@ -438,7 +438,7 @@ def on_start_object_serialization( ) -> None: """Sets the callback called right after the serialization process starts. Args: - value (Optional[Callable[[Parsable, SerializationWriter], None]]): the callback + value (Optional[Callable[[Parsable, SerializationWriter], None]]): The callback called right after the serialization process starts. """ self._on_start_object_serialization = value @@ -471,7 +471,10 @@ def write_any_value(self, key: Optional[str], value: Any) -> Any: self.write_collection_of_object_values(key, value) elif all(isinstance(x, Enum) for x in value): self.write_collection_of_enum_values(key, value) - elif all(any(isinstance(x, primitive_type) for primitive_type in PRIMITIVE_TYPES) for x in value): + elif all( + any(isinstance(x, primitive_type) for primitive_type in PRIMITIVE_TYPES) + for x in value + ): self.write_collection_of_primitive_values(key, value) elif all(isinstance(x, dict) for x in value): self.__write_collection_of_dict_values(key, value) diff --git a/tests/unit/test_json_serialization_writer.py b/tests/unit/test_json_serialization_writer.py index 36261b9..202a9c1 100644 --- a/tests/unit/test_json_serialization_writer.py +++ b/tests/unit/test_json_serialization_writer.py @@ -2,7 +2,6 @@ from uuid import UUID import pytest - import pendulum from kiota_serialization_json.json_serialization_writer import JsonSerializationWriter @@ -72,20 +71,23 @@ def test_write_uuid_value(): content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"id": "8f841f30-e6e3-439a-a812-ebd369559c36"}' - + + def test_write_uuid_value_with_valid_string(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_uuid_value("id", "8f841f30-e6e3-439a-a812-ebd369559c36") content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"id": "8f841f30-e6e3-439a-a812-ebd369559c36"}' - + + def test_write_uuid_value_with_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_uuid_value("id", "invalid-uuid-string") assert "Invalid UUID string value found for property id" in str(excinfo.value) - + + def test_write_datetime_value(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_datetime_value( @@ -94,7 +96,8 @@ def test_write_datetime_value(): content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"updatedAt": "2022-01-27T12:59:45.596117+00:00"}' - + + def test_write_datetime_value_valid_string(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_datetime_value( @@ -103,8 +106,9 @@ def test_write_datetime_value_valid_string(): content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"updatedAt": "2022-01-27T12:59:45.596117+00:00"}' - -def test_write_datetime_value_valid_string(): + + +def test_write_datetime_value_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_datetime_value( @@ -112,16 +116,21 @@ def test_write_datetime_value_valid_string(): ) assert "Invalid datetime string value found for property updatedAt" in str(excinfo.value) + def test_write_timedelta_value(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_timedelta_value( "diff", - (pendulum.parse('2022-01-27T12:59:45.596117') - pendulum.parse('2022-01-27T10:59:45.596117')).as_timedelta() + ( + pendulum.parse('2022-01-27T12:59:45.596117') - + pendulum.parse('2022-01-27T10:59:45.596117') + ).as_timedelta() ) content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"diff": "2:00:00"}' - + + def test_write_timedelta_value_valid_string(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_timedelta_value( @@ -131,7 +140,8 @@ def test_write_timedelta_value_valid_string(): content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"diff": "2:00:00"}' - + + def test_write_timedelta_value_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() @@ -140,7 +150,7 @@ def test_write_timedelta_value_invalid_string(): "invalid-timedelta-string" ) assert "Invalid timedelta string value found for property diff" in str(excinfo.value) - + def test_write_date_value(): json_serialization_writer = JsonSerializationWriter() @@ -149,19 +159,22 @@ def test_write_date_value(): content_string = content.decode('utf-8') assert content_string == '{"birthday": "2000-09-04"}' + def test_write_date_value_valid_string(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_date_value("birthday", "2000-09-04") content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"birthday": "2000-09-04"}' - + + def test_write_date_value_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_date_value("birthday", "invalid-date-string") assert "Invalid date string value found for property birthday" in str(excinfo.value) + def test_write_time_value(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_time_value( @@ -172,6 +185,7 @@ def test_write_time_value(): content_string = content.decode('utf-8') assert content_string == '{"time": "12:59:45.596117"}' + def test_write_time_value_valid_string(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_time_value( @@ -181,7 +195,8 @@ def test_write_time_value_valid_string(): content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"time": "12:59:45.596117"}' - + + def test_write_time_value_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() @@ -191,6 +206,7 @@ def test_write_time_value_invalid_string(): ) assert "Invalid time string value found for property time" in str(excinfo.value) + def test_write_collection_of_primitive_values(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_collection_of_primitive_values( @@ -206,9 +222,14 @@ def test_write_collection_of_object_values(user_1, user_2): json_serialization_writer.write_collection_of_object_values("users", [user_1, user_2]) content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') - assert content_string == '{"users": [{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ - '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ - '{"display_name": "John Doe", "age": 32}]}' + expected = ( + '{"users": [' + '{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' + '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, ' + '{"display_name": "John Doe", "age": 32}' + ']}' + ) + assert content_string == expected def test_write_collection_of_enum_values(): @@ -226,8 +247,13 @@ def test_write_object_value(user_1): json_serialization_writer.write_object_value("user1", user_1) content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') - assert content_string == '{"user1": {"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ - '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}}' + expected = ( + '{"user1": {' + '"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' + '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true' + '}}' + ) + assert content_string == expected def test_write_enum_value(): @@ -265,14 +291,18 @@ def test_write_additional_data_value(user_1, user_2): ) content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') - assert content_string == '{"@odata.context": '\ - '"https://graph.microsoft.com/v1.0/$metadata#users/$entity", '\ - '"businessPhones": ["+1 205 555 0108"], '\ - '"manager": {"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ - '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ - '"approvers": [{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", '\ - '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, '\ - '{"display_name": "John Doe", "age": 32}], '\ - '"created_at": "2022-01-27", '\ - '"updated_at": "2024-09-24T00:00:00", '\ - '"data": {"groups": [{"friends": [{"display_name": "John Doe", "age": 32}]}]}}' + expected = ( + '{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity", ' + '"businessPhones": ["+1 205 555 0108"], ' + '"manager": {"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' + '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, ' + '"approvers": [' + '{"id": "8f841f30-e6e3-439a-a812-ebd369559c36", ' + '"updated_at": "2022-01-27T12:59:45.596117+00:00", "is_active": true}, ' + '{"display_name": "John Doe", "age": 32}' + '], ' + '"created_at": "2022-01-27", ' + '"updated_at": "2024-09-24T00:00:00", ' + '"data": {"groups": [{"friends": [{"display_name": "John Doe", "age": 32}]}]}}' + ) + assert content_string == expected From 4cdba4dab613338da0aba7e253fb7384f393de1f Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 3 Oct 2024 11:55:11 -0400 Subject: [PATCH 101/105] chore: linting --- .../json_serialization_writer.py | 14 ++++----- tests/unit/test_json_parse_node_factory.py | 2 +- tests/unit/test_json_serialization_writer.py | 31 +++++-------------- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/kiota_serialization_json/json_serialization_writer.py b/kiota_serialization_json/json_serialization_writer.py index a585822..efeb4f7 100644 --- a/kiota_serialization_json/json_serialization_writer.py +++ b/kiota_serialization_json/json_serialization_writer.py @@ -191,7 +191,7 @@ def write_time_value(self, key: Optional[str], value: Optional[time]) -> None: raise ValueError("Invalid time string value found") def write_collection_of_primitive_values( - self, key: Optional[str], values: Optional[List[T]] + self, key: Optional[str], values: Optional[List[T]] ) -> None: """Writes the specified collection of primitive values to the stream with an optional given key. @@ -212,7 +212,7 @@ def write_collection_of_primitive_values( self.value = result def write_collection_of_object_values( - self, key: Optional[str], values: Optional[List[U]] + self, key: Optional[str], values: Optional[List[U]] ) -> None: """Writes the specified collection of model objects to the stream with an optional given key. @@ -233,7 +233,7 @@ def write_collection_of_object_values( self.value = obj_list def write_collection_of_enum_values( - self, key: Optional[str], values: Optional[List[Enum]] + self, key: Optional[str], values: Optional[List[Enum]] ) -> None: """Writes the specified collection of enum values to the stream with an optional given key. Args: @@ -253,7 +253,7 @@ def write_collection_of_enum_values( self.value = result def __write_collection_of_dict_values( - self, key: Optional[str], values: Optional[List[Dict[str, Any]]] + self, key: Optional[str], values: Optional[List[Dict[str, Any]]] ) -> None: """Writes the specified collection of dictionary values to the stream with an optional given key. @@ -290,7 +290,7 @@ def write_bytes_value(self, key: Optional[str], value: bytes) -> None: self.value = base64_string def write_object_value( - self, key: Optional[str], value: Optional[U], *additional_values_to_merge: U + self, key: Optional[str], value: Optional[U], *additional_values_to_merge: U ) -> None: """Writes the specified model object to the stream with an optional given key. Args: @@ -423,7 +423,7 @@ def on_after_object_serialization(self, value: Optional[Callable[[Parsable], Non @property def on_start_object_serialization( - self + self ) -> Optional[Callable[[Parsable, SerializationWriter], None]]: """Gets the callback called right after the serialization process starts. Returns: @@ -434,7 +434,7 @@ def on_start_object_serialization( @on_start_object_serialization.setter def on_start_object_serialization( - self, value: Optional[Callable[[Parsable, SerializationWriter], None]] + self, value: Optional[Callable[[Parsable, SerializationWriter], None]] ) -> None: """Sets the callback called right after the serialization process starts. Args: diff --git a/tests/unit/test_json_parse_node_factory.py b/tests/unit/test_json_parse_node_factory.py index 174875a..2975f37 100644 --- a/tests/unit/test_json_parse_node_factory.py +++ b/tests/unit/test_json_parse_node_factory.py @@ -18,7 +18,7 @@ def test_get_root_parse_node(sample_json_string): assert isinstance(root, JsonParseNode) assert root._json_node == json.loads(sample_json_string) - + def test_get_root_parse_node_no_content_type(sample_json_string): with pytest.raises(Exception) as e_info: factory = JsonParseNodeFactory() diff --git a/tests/unit/test_json_serialization_writer.py b/tests/unit/test_json_serialization_writer.py index 202a9c1..adf2e14 100644 --- a/tests/unit/test_json_serialization_writer.py +++ b/tests/unit/test_json_serialization_writer.py @@ -100,9 +100,7 @@ def test_write_datetime_value(): def test_write_datetime_value_valid_string(): json_serialization_writer = JsonSerializationWriter() - json_serialization_writer.write_datetime_value( - "updatedAt", "2022-01-27T12:59:45.596117" - ) + json_serialization_writer.write_datetime_value("updatedAt", "2022-01-27T12:59:45.596117") content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"updatedAt": "2022-01-27T12:59:45.596117+00:00"}' @@ -111,17 +109,14 @@ def test_write_datetime_value_valid_string(): def test_write_datetime_value_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() - json_serialization_writer.write_datetime_value( - "updatedAt", "invalid-datetime-string" - ) + json_serialization_writer.write_datetime_value("updatedAt", "invalid-datetime-string") assert "Invalid datetime string value found for property updatedAt" in str(excinfo.value) def test_write_timedelta_value(): json_serialization_writer = JsonSerializationWriter() json_serialization_writer.write_timedelta_value( - "diff", - ( + "diff", ( pendulum.parse('2022-01-27T12:59:45.596117') - pendulum.parse('2022-01-27T10:59:45.596117') ).as_timedelta() @@ -133,10 +128,7 @@ def test_write_timedelta_value(): def test_write_timedelta_value_valid_string(): json_serialization_writer = JsonSerializationWriter() - json_serialization_writer.write_timedelta_value( - "diff", - "2:00:00" - ) + json_serialization_writer.write_timedelta_value("diff", "2:00:00") content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"diff": "2:00:00"}' @@ -145,10 +137,7 @@ def test_write_timedelta_value_valid_string(): def test_write_timedelta_value_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() - json_serialization_writer.write_timedelta_value( - "diff", - "invalid-timedelta-string" - ) + json_serialization_writer.write_timedelta_value("diff", "invalid-timedelta-string") assert "Invalid timedelta string value found for property diff" in str(excinfo.value) @@ -188,10 +177,7 @@ def test_write_time_value(): def test_write_time_value_valid_string(): json_serialization_writer = JsonSerializationWriter() - json_serialization_writer.write_time_value( - "time", - "12:59:45.596117" - ) + json_serialization_writer.write_time_value("time", "12:59:45.596117") content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') assert content_string == '{"time": "12:59:45.596117"}' @@ -200,10 +186,7 @@ def test_write_time_value_valid_string(): def test_write_time_value_invalid_string(): with pytest.raises(ValueError) as excinfo: json_serialization_writer = JsonSerializationWriter() - json_serialization_writer.write_time_value( - "time", - "invalid-time-string" - ) + json_serialization_writer.write_time_value("time", "invalid-time-string") assert "Invalid time string value found for property time" in str(excinfo.value) From 08d26bbe75d8829ad628dd6b981eb5bcf1df6a60 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 3 Oct 2024 11:59:34 -0400 Subject: [PATCH 102/105] chore: more linting Signed-off-by: Vincent Biret --- kiota_serialization_json/json_serialization_writer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kiota_serialization_json/json_serialization_writer.py b/kiota_serialization_json/json_serialization_writer.py index efeb4f7..534e937 100644 --- a/kiota_serialization_json/json_serialization_writer.py +++ b/kiota_serialization_json/json_serialization_writer.py @@ -480,7 +480,8 @@ def write_any_value(self, key: Optional[str], value: Any) -> Any: self.__write_collection_of_dict_values(key, value) else: raise TypeError( - f"Encountered an unknown collection type during serialization {type(value)} with key {key}" + f"Encountered an unknown collection type during serialization {type(value)} \ + with key {key}" ) elif isinstance(value, dict): self.__write_dict_value(key, value) From 61c3e3964091a800fec4cefab5630cfe88ed6b17 Mon Sep 17 00:00:00 2001 From: eranavrahami Date: Thu, 3 Oct 2024 19:18:04 +0300 Subject: [PATCH 103/105] fix test_write_datetime_value_valid_string --- tests/unit/test_json_serialization_writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_json_serialization_writer.py b/tests/unit/test_json_serialization_writer.py index adf2e14..462b92b 100644 --- a/tests/unit/test_json_serialization_writer.py +++ b/tests/unit/test_json_serialization_writer.py @@ -103,7 +103,7 @@ def test_write_datetime_value_valid_string(): json_serialization_writer.write_datetime_value("updatedAt", "2022-01-27T12:59:45.596117") content = json_serialization_writer.get_serialized_content() content_string = content.decode('utf-8') - assert content_string == '{"updatedAt": "2022-01-27T12:59:45.596117+00:00"}' + assert content_string == '{"updatedAt": "2022-01-27T12:59:45.596117"}' def test_write_datetime_value_invalid_string(): From 5207a8fcb7775a3b31f006c2575d99c61c9c4499 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 06:08:53 +0000 Subject: [PATCH 104/105] chore(deps-dev): bump charset-normalizer from 3.3.2 to 3.4.0 Bumps [charset-normalizer](https://github.com/Ousret/charset_normalizer) from 3.3.2 to 3.4.0. - [Release notes](https://github.com/Ousret/charset_normalizer/releases) - [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/Ousret/charset_normalizer/compare/3.3.2...3.4.0) --- updated-dependencies: - dependency-name: charset-normalizer dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e6a2d91..dd01a37 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ astroid==3.2.4 certifi==2024.8.30 -charset-normalizer==3.3.2 +charset-normalizer==3.4.0 coverage[toml]==7.6.1 From fa83158e9290f1456df7fe77612924703efd2c89 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 14 Oct 2024 18:11:09 +0300 Subject: [PATCH 105/105] chore: update readme for archive --- README.md | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/README.md b/README.md index 46c8d17..5b81f69 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,3 @@ # Microsoft Kiota Serialization library for JSON -[![PyPI version](https://badge.fury.io/py/microsoft-kiota-serialization-json.svg)](https://badge.fury.io/py/microsoft-kiota-serialization-json) -[![CI Actions Status](https://github.com/microsoft/kiota-serialization-json-python/actions/workflows/build_publish.yml/badge.svg?branch=main)](https://github.com/microsoft/kiota-serialization-json-python/actions) -[![Downloads](https://pepy.tech/badge/microsoft-kiota-serialization-json)](https://pepy.tech/project/microsoft-kiota-serialization-json) -The Microsoft Kiota Serialization Library for JSON is a python implementation to serialize/deserialize JSON. - -A [Kiota](https://github.com/microsoft/kiota) generated project will need a reference to a json serialization package to handle json payloads from an API endpoint. - -Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md). - -## Using the Microsoft Kiota Serialization JSON library - -In order to use this library, install the package by running: - -```cmd -pip install microsoft-kiota-serialization-json -``` - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. - -When you submit a pull request, a CLA bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -## Trademarks - -This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft -trademarks or logos is subject to and must follow -[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). -Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. -Any use of third-party trademarks or logos are subject to those third-party's policies. +This repository has been archived and source migrated. You can contribute and file issues in the [Kiota Python](https://github.com/microsoft/kiota-python) repository.