From 505a06bca43da45106d6a200869069f7a0e4ba9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 04:12:26 +0000 Subject: [PATCH 01/10] chore(deps): bump gunicorn from 21.2.0 to 22.0.0 Bumps [gunicorn](https://github.com/benoitc/gunicorn) from 21.2.0 to 22.0.0. - [Release notes](https://github.com/benoitc/gunicorn/releases) - [Commits](https://github.com/benoitc/gunicorn/compare/21.2.0...22.0.0) --- updated-dependencies: - dependency-name: gunicorn dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index fa50023..e58101e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "alabaster" @@ -572,22 +572,23 @@ test = ["objgraph", "psutil"] [[package]] name = "gunicorn" -version = "21.2.0" +version = "22.0.0" description = "WSGI HTTP Server for UNIX" optional = true -python-versions = ">=3.5" +python-versions = ">=3.7" files = [ - {file = "gunicorn-21.2.0-py3-none-any.whl", hash = "sha256:3213aa5e8c24949e792bcacfc176fef362e7aac80b76c56f6b5122bf350722f0"}, - {file = "gunicorn-21.2.0.tar.gz", hash = "sha256:88ec8bff1d634f98e61b9f65bc4bf3cd918a90806c6f5c48bc5603849ec81033"}, + {file = "gunicorn-22.0.0-py3-none-any.whl", hash = "sha256:350679f91b24062c86e386e198a15438d53a7a8207235a78ba1b53df4c4378d9"}, + {file = "gunicorn-22.0.0.tar.gz", hash = "sha256:4a0b436239ff76fb33f11c07a16482c521a7e09c1ce3cc293c2330afe01bec63"}, ] [package.dependencies] packaging = "*" [package.extras] -eventlet = ["eventlet (>=0.24.1)"] +eventlet = ["eventlet (>=0.24.1,!=0.36.0)"] gevent = ["gevent (>=1.4.0)"] setproctitle = ["setproctitle"] +testing = ["coverage", "eventlet", "gevent", "pytest", "pytest-cov"] tornado = ["tornado (>=0.2)"] [[package]] @@ -1351,6 +1352,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 7a3529e9216bea7777b3d6ad4eb59194a5c89d92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 04:13:44 +0000 Subject: [PATCH 02/10] chore(deps-dev): bump sphinx from 6.2.1 to 7.1.2 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 6.2.1 to 7.1.2. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v6.2.1...v7.1.2) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 13 +++++++------ pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index fa50023..3401014 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "alabaster" @@ -1351,6 +1351,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -1460,20 +1461,20 @@ files = [ [[package]] name = "sphinx" -version = "6.2.1" +version = "7.1.2" description = "Python documentation generator" optional = false python-versions = ">=3.8" files = [ - {file = "Sphinx-6.2.1.tar.gz", hash = "sha256:6d56a34697bb749ffa0152feafc4b19836c755d90a7c59b72bc7dfd371b9cc6b"}, - {file = "sphinx-6.2.1-py3-none-any.whl", hash = "sha256:97787ff1fa3256a3eef9eda523a63dbf299f7b47e053cfcf684a1c2a8380c912"}, + {file = "sphinx-7.1.2-py3-none-any.whl", hash = "sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe"}, + {file = "sphinx-7.1.2.tar.gz", hash = "sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f"}, ] [package.dependencies] alabaster = ">=0.7,<0.8" babel = ">=2.9" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -docutils = ">=0.18.1,<0.20" +docutils = ">=0.18.1,<0.21" imagesize = ">=1.3" importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} Jinja2 = ">=3.0" @@ -1951,4 +1952,4 @@ dashboard = ["flask", "flask-admin", "flask-sqlalchemy", "gunicorn", "python-dec [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "aed89cfe847a4aa0a3a15d58dbe889573fdfda546ceba54273201e0de013ec16" +content-hash = "4541e722619c57bdd3a60df86d1fabf991e8604d734897d1e5d37f535ad302c3" diff --git a/pyproject.toml b/pyproject.toml index 1d73062..5c5338f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ types-requests = "^2.31.0.20240406" [tool.poetry.group.docs.dependencies] -sphinx = "^6" +sphinx = ">=6,<8" sphinx-rtd-theme = "^1.2.0" sphinxcontrib-napoleon = "^0.7" myst-parser = "^2.0.0" From 4703d3f42676cfed508f0b7bbcf43ea57250946a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 04:14:05 +0000 Subject: [PATCH 03/10] chore(deps-dev): bump black from 24.3.0 to 24.4.2 Bumps [black](https://github.com/psf/black) from 24.3.0 to 24.4.2. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.3.0...24.4.2) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/poetry.lock b/poetry.lock index fa50023..e159017 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "alabaster" @@ -44,33 +44,33 @@ dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] [[package]] name = "black" -version = "24.3.0" +version = "24.4.2" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" files = [ - {file = "black-24.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395"}, - {file = "black-24.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995"}, - {file = "black-24.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7"}, - {file = "black-24.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0"}, - {file = "black-24.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9"}, - {file = "black-24.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597"}, - {file = "black-24.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d"}, - {file = "black-24.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5"}, - {file = "black-24.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f"}, - {file = "black-24.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11"}, - {file = "black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4"}, - {file = "black-24.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5"}, - {file = "black-24.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837"}, - {file = "black-24.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd"}, - {file = "black-24.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213"}, - {file = "black-24.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959"}, - {file = "black-24.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb"}, - {file = "black-24.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7"}, - {file = "black-24.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7"}, - {file = "black-24.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f"}, - {file = "black-24.3.0-py3-none-any.whl", hash = "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93"}, - {file = "black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f"}, + {file = "black-24.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dd1b5a14e417189db4c7b64a6540f31730713d173f0b63e55fabd52d61d8fdce"}, + {file = "black-24.4.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e537d281831ad0e71007dcdcbe50a71470b978c453fa41ce77186bbe0ed6021"}, + {file = "black-24.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaea3008c281f1038edb473c1aa8ed8143a5535ff18f978a318f10302b254063"}, + {file = "black-24.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:7768a0dbf16a39aa5e9a3ded568bb545c8c2727396d063bbaf847df05b08cd96"}, + {file = "black-24.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:257d724c2c9b1660f353b36c802ccece186a30accc7742c176d29c146df6e474"}, + {file = "black-24.4.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bdde6f877a18f24844e381d45e9947a49e97933573ac9d4345399be37621e26c"}, + {file = "black-24.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e151054aa00bad1f4e1f04919542885f89f5f7d086b8a59e5000e6c616896ffb"}, + {file = "black-24.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:7e122b1c4fb252fd85df3ca93578732b4749d9be076593076ef4d07a0233c3e1"}, + {file = "black-24.4.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:accf49e151c8ed2c0cdc528691838afd217c50412534e876a19270fea1e28e2d"}, + {file = "black-24.4.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:88c57dc656038f1ab9f92b3eb5335ee9b021412feaa46330d5eba4e51fe49b04"}, + {file = "black-24.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be8bef99eb46d5021bf053114442914baeb3649a89dc5f3a555c88737e5e98fc"}, + {file = "black-24.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:415e686e87dbbe6f4cd5ef0fbf764af7b89f9057b97c908742b6008cc554b9c0"}, + {file = "black-24.4.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bf10f7310db693bb62692609b397e8d67257c55f949abde4c67f9cc574492cc7"}, + {file = "black-24.4.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:98e123f1d5cfd42f886624d84464f7756f60ff6eab89ae845210631714f6db94"}, + {file = "black-24.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48a85f2cb5e6799a9ef05347b476cce6c182d6c71ee36925a6c194d074336ef8"}, + {file = "black-24.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:b1530ae42e9d6d5b670a34db49a94115a64596bc77710b1d05e9801e62ca0a7c"}, + {file = "black-24.4.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:37aae07b029fa0174d39daf02748b379399b909652a806e5708199bd93899da1"}, + {file = "black-24.4.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:da33a1a5e49c4122ccdfd56cd021ff1ebc4a1ec4e2d01594fef9b6f267a9e741"}, + {file = "black-24.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef703f83fc32e131e9bcc0a5094cfe85599e7109f896fe8bc96cc402f3eb4b6e"}, + {file = "black-24.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:b9176b9832e84308818a99a561e90aa479e73c523b3f77afd07913380ae2eab7"}, + {file = "black-24.4.2-py3-none-any.whl", hash = "sha256:d36ed1124bb81b32f8614555b34cc4259c3fbc7eec17870e8ff8ded335b58d8c"}, + {file = "black-24.4.2.tar.gz", hash = "sha256:c872b53057f000085da66a19c55d68f6f8ddcac2642392ad3a355878406fbd4d"}, ] [package.dependencies] @@ -1351,6 +1351,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 3c1baea8dfc196005e514dcc83c8e5cf83cdfa5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 18:57:10 +0000 Subject: [PATCH 04/10] chore(deps): bump actions/configure-pages from 4 to 5 Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 4 to 5. - [Release notes](https://github.com/actions/configure-pages/releases) - [Commits](https://github.com/actions/configure-pages/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/configure-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 053ac75..10147e5 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -63,7 +63,7 @@ jobs: retention-days: 30 - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@v5 if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') - name: Upload artifact From 7db69687b257da75fd54fe728fea6c2662724f16 Mon Sep 17 00:00:00 2001 From: lpofredc Date: Mon, 10 Jun 2024 12:12:17 +0200 Subject: [PATCH 05/10] fix #73, fix trigger to populate additional data --- gn2pg/data/to_gnsynthese.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gn2pg/data/to_gnsynthese.sql b/gn2pg/data/to_gnsynthese.sql index 6701537..68ccd34 100644 --- a/gn2pg/data/to_gnsynthese.sql +++ b/gn2pg/data/to_gnsynthese.sql @@ -701,7 +701,7 @@ BEGIN INTO the_comment_context; SELECT new.item #>> '{comment_occurrence}' INTO the_comment_description; - SELECT new.item #> '{additional_data}' + SELECT new.item #> '{donnees_additionnelles}' INTO the_additional_data; SELECT NULL INTO the_meta_validation_date; From 1fe8125e430bf67649e0bbf74f23d296cebfdf0d Mon Sep 17 00:00:00 2001 From: lpofredc Date: Mon, 10 Jun 2024 12:14:38 +0200 Subject: [PATCH 06/10] update version --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b0342..eeb25f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this +## 1.6.5 - 2024-06-10 + +### Fixes + +- Fix trigger to populate additional data (fix #73). + ## 1.6.4 - 2024-04-24 -## Fixes +### Fixes - Fix typo error on trigger scripts. From 60cd8082320c7fc733eb59901485246586310fba Mon Sep 17 00:00:00 2001 From: lpofredc Date: Mon, 10 Jun 2024 13:48:50 +0200 Subject: [PATCH 07/10] fix version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1d73062..0b3f52b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "gn2pg_client" packages = [{ include = "gn2pg" }] -version = "1.6.4" +version = "1.6.5" description = "Import tool from GeoNature to a PostgreSQL database through Export module API (client side)" authors = ["lpofredc "] maintainers = ["lpofredc "] From 8338ed5d370b0ddd2efb16cecbd88e9602211b37 Mon Sep 17 00:00:00 2001 From: lpofredc Date: Tue, 30 Jul 2024 17:49:53 +0200 Subject: [PATCH 08/10] update synthese with nomenclatures view for more af metadata --- .../geonature_export_sinp_with_metadata.sql | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/data/source_samples/geonature_export_sinp_with_metadata.sql b/data/source_samples/geonature_export_sinp_with_metadata.sql index 2f02e51..57c2f5c 100644 --- a/data/source_samples/geonature_export_sinp_with_metadata.sql +++ b/data/source_samples/geonature_export_sinp_with_metadata.sql @@ -22,26 +22,72 @@ WITH af_actors AS (SELECT cafa.id_acquisition_framework, LEFT JOIN utilisateurs.t_roles tro ON cafa.id_role = tro.id_role JOIN ref_nomenclatures.t_nomenclatures tn ON cafa.id_nomenclature_actor_role = tn.id_nomenclature), - af AS (SELECT taf.id_acquisition_framework, - jsonb_build_object('uuid', taf.unique_acquisition_framework_id, 'name', + af_territories AS (SELECT caft.id_acquisition_framework, + array_agg(DISTINCT t_nomenclatures.cd_nomenclature) AS territories + FROM gn_meta.cor_acquisition_framework_territory caft + LEFT JOIN ref_nomenclatures.t_nomenclatures + ON caft.id_nomenclature_territory = + t_nomenclatures.id_nomenclature + GROUP BY caft.id_acquisition_framework), + af_objectives AS (SELECT cafo.id_acquisition_framework, + array_agg(DISTINCT t_nomenclatures.cd_nomenclature) AS objectives + FROM gn_meta.cor_acquisition_framework_objectif cafo + LEFT JOIN ref_nomenclatures.t_nomenclatures + ON cafo.id_nomenclature_objectif = + t_nomenclatures.id_nomenclature + GROUP BY cafo.id_acquisition_framework), + af_voletsinp AS (SELECT cafv.id_acquisition_framework, + array_agg(DISTINCT t_nomenclatures.cd_nomenclature) AS voletsinp + FROM gn_meta.cor_acquisition_framework_voletsinp cafv + LEFT JOIN ref_nomenclatures.t_nomenclatures + ON cafv.id_nomenclature_voletsinp = + t_nomenclatures.id_nomenclature + GROUP BY cafv.id_acquisition_framework), + af_publication AS (SELECT cafp.id_acquisition_framework, + array_agg(DISTINCT + jsonb_build_object('uuid', sinp_datatype_publications.unique_publication_id, + 'reference', + sinp_datatype_publications.publication_reference, + 'url', + sinp_datatype_publications.publication_url)) AS publications + FROM gn_meta.cor_acquisition_framework_publication cafp + LEFT JOIN gn_meta.sinp_datatype_publications + ON cafp.id_publication = sinp_datatype_publications.id_publication + GROUP BY cafp.id_acquisition_framework) +-- , +-- af AS + (SELECT taf.id_acquisition_framework, + jsonb_pretty(jsonb_build_object('uuid', taf.unique_acquisition_framework_id, 'name', taf.acquisition_framework_name, 'desc', taf.acquisition_framework_desc, 'start_date', taf.acquisition_framework_start_date, 'end_date', taf.acquisition_framework_end_date, - 'initial_closing_date', taf.initial_closing_date, 'territorial_level', - ntl.cd_nomenclature, 'financing_type', nft.cd_nomenclature, 'target_description', + 'initial_closing_date', taf.initial_closing_date, 'territories', + af_territories.territories, 'territorial_level', + ntl.cd_nomenclature, 'territory_desc', taf.territory_desc, 'objectives', + af_objectives.objectives, 'publications', af_publication.publications, + 'financing_type', nft.cd_nomenclature, + 'target_description', taf.target_description, 'ecologic_or_geologic_target', taf.ecologic_or_geologic_target, 'actors', - json_agg(af_actors.json_data)) AS af_data + json_agg(af_actors.json_data), 'is_parent', taf.is_parent, 'parent_uuid', + tafp.unique_acquisition_framework_id)) AS af_data FROM gn_meta.t_acquisition_frameworks taf + LEFT JOIN gn_meta.t_acquisition_frameworks tafp + ON tafp.id_acquisition_framework = taf.acquisition_framework_parent_id JOIN af_actors ON af_actors.id_acquisition_framework = taf.id_acquisition_framework LEFT JOIN ref_nomenclatures.t_nomenclatures ntl ON taf.id_nomenclature_territorial_level = ntl.id_nomenclature LEFT JOIN ref_nomenclatures.t_nomenclatures nft ON taf.id_nomenclature_financing_type = nft.id_nomenclature + LEFT JOIN af_territories ON af_territories.id_acquisition_framework = taf.id_acquisition_framework + LEFT JOIN af_objectives ON af_objectives.id_acquisition_framework = taf.id_acquisition_framework + LEFT JOIN af_voletsinp ON af_voletsinp.id_acquisition_framework = taf.id_acquisition_framework + LEFT JOIN af_publication ON af_publication.id_acquisition_framework = taf.id_acquisition_framework GROUP BY taf.id_acquisition_framework, taf.acquisition_framework_name, taf.acquisition_framework_desc, taf.acquisition_framework_start_date, taf.acquisition_framework_end_date, taf.initial_closing_date, - ntl.cd_nomenclature, nft.cd_nomenclature), + ntl.cd_nomenclature, nft.cd_nomenclature, af_territories.territories, af_objectives.objectives, + af_voletsinp.voletsinp, af_publication.publications, taf.is_parent,tafp.unique_acquisition_framework_id), ds_actors AS (SELECT cda.id_dataset, json_build_object('type_role', CASE From 55a08a59cb51d0706d8cd6cac8d95bd3bbd225e0 Mon Sep 17 00:00:00 2001 From: lpofredc Date: Tue, 30 Jul 2024 22:43:33 +0200 Subject: [PATCH 09/10] update synthese with nomenclatures view for more ds metadata --- .../geonature_export_sinp_with_metadata.sql | 90 +++++++++++-------- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/data/source_samples/geonature_export_sinp_with_metadata.sql b/data/source_samples/geonature_export_sinp_with_metadata.sql index 57c2f5c..bf85674 100644 --- a/data/source_samples/geonature_export_sinp_with_metadata.sql +++ b/data/source_samples/geonature_export_sinp_with_metadata.sql @@ -54,40 +54,41 @@ WITH af_actors AS (SELECT cafa.id_acquisition_framework, LEFT JOIN gn_meta.sinp_datatype_publications ON cafp.id_publication = sinp_datatype_publications.id_publication GROUP BY cafp.id_acquisition_framework) --- , --- af AS + , + af AS (SELECT taf.id_acquisition_framework, - jsonb_pretty(jsonb_build_object('uuid', taf.unique_acquisition_framework_id, 'name', - taf.acquisition_framework_name, - 'desc', taf.acquisition_framework_desc, 'start_date', - taf.acquisition_framework_start_date, 'end_date', - taf.acquisition_framework_end_date, - 'initial_closing_date', taf.initial_closing_date, 'territories', - af_territories.territories, 'territorial_level', - ntl.cd_nomenclature, 'territory_desc', taf.territory_desc, 'objectives', - af_objectives.objectives, 'publications', af_publication.publications, - 'financing_type', nft.cd_nomenclature, - 'target_description', - taf.target_description, 'ecologic_or_geologic_target', - taf.ecologic_or_geologic_target, 'actors', - json_agg(af_actors.json_data), 'is_parent', taf.is_parent, 'parent_uuid', - tafp.unique_acquisition_framework_id)) AS af_data - FROM gn_meta.t_acquisition_frameworks taf - LEFT JOIN gn_meta.t_acquisition_frameworks tafp - ON tafp.id_acquisition_framework = taf.acquisition_framework_parent_id - JOIN af_actors ON af_actors.id_acquisition_framework = taf.id_acquisition_framework - LEFT JOIN ref_nomenclatures.t_nomenclatures ntl - ON taf.id_nomenclature_territorial_level = ntl.id_nomenclature - LEFT JOIN ref_nomenclatures.t_nomenclatures nft - ON taf.id_nomenclature_financing_type = nft.id_nomenclature - LEFT JOIN af_territories ON af_territories.id_acquisition_framework = taf.id_acquisition_framework - LEFT JOIN af_objectives ON af_objectives.id_acquisition_framework = taf.id_acquisition_framework - LEFT JOIN af_voletsinp ON af_voletsinp.id_acquisition_framework = taf.id_acquisition_framework - LEFT JOIN af_publication ON af_publication.id_acquisition_framework = taf.id_acquisition_framework - GROUP BY taf.id_acquisition_framework, taf.acquisition_framework_name, taf.acquisition_framework_desc, - taf.acquisition_framework_start_date, taf.acquisition_framework_end_date, taf.initial_closing_date, - ntl.cd_nomenclature, nft.cd_nomenclature, af_territories.territories, af_objectives.objectives, - af_voletsinp.voletsinp, af_publication.publications, taf.is_parent,tafp.unique_acquisition_framework_id), + jsonb_build_object('uuid', taf.unique_acquisition_framework_id, 'name', + taf.acquisition_framework_name, + 'desc', taf.acquisition_framework_desc, 'start_date', + taf.acquisition_framework_start_date, 'end_date', + taf.acquisition_framework_end_date, + 'initial_closing_date', taf.initial_closing_date, 'territories', + af_territories.territories, 'territorial_level', + ntl.cd_nomenclature, 'territory_desc', taf.territory_desc, 'objectives', + af_objectives.objectives, 'publications', af_publication.publications, + 'financing_type', nft.cd_nomenclature, + 'target_description', + taf.target_description, 'ecologic_or_geologic_target', + taf.ecologic_or_geologic_target, 'actors', + json_agg(af_actors.json_data), 'is_parent', taf.is_parent, 'parent_uuid', + tafp.unique_acquisition_framework_id) AS af_data + FROM gn_meta.t_acquisition_frameworks taf + LEFT JOIN gn_meta.t_acquisition_frameworks tafp + ON tafp.id_acquisition_framework = taf.acquisition_framework_parent_id + JOIN af_actors ON af_actors.id_acquisition_framework = taf.id_acquisition_framework + LEFT JOIN ref_nomenclatures.t_nomenclatures ntl + ON taf.id_nomenclature_territorial_level = ntl.id_nomenclature + LEFT JOIN ref_nomenclatures.t_nomenclatures nft + ON taf.id_nomenclature_financing_type = nft.id_nomenclature + LEFT JOIN af_territories ON af_territories.id_acquisition_framework = taf.id_acquisition_framework + LEFT JOIN af_objectives ON af_objectives.id_acquisition_framework = taf.id_acquisition_framework + LEFT JOIN af_voletsinp ON af_voletsinp.id_acquisition_framework = taf.id_acquisition_framework + LEFT JOIN af_publication ON af_publication.id_acquisition_framework = taf.id_acquisition_framework + GROUP BY taf.id_acquisition_framework, taf.acquisition_framework_name, taf.acquisition_framework_desc, + taf.acquisition_framework_start_date, taf.acquisition_framework_end_date, taf.initial_closing_date, + ntl.cd_nomenclature, nft.cd_nomenclature, af_territories.territories, af_objectives.objectives, + af_voletsinp.voletsinp, af_publication.publications, taf.is_parent, + tafp.unique_acquisition_framework_id), ds_actors AS (SELECT cda.id_dataset, json_build_object('type_role', CASE @@ -109,12 +110,29 @@ WITH af_actors AS (SELECT cafa.id_acquisition_framework, LEFT JOIN utilisateurs.t_roles tro ON cda.id_role = tro.id_role JOIN ref_nomenclatures.t_nomenclatures tn ON cda.id_nomenclature_actor_role = tn.id_nomenclature), + ds_protocols AS (SELECT cdp.id_dataset, + jsonb_build_object( + 'uuid', sdp.unique_protocol_id, + 'name', sdp.protocol_name, + 'desc', sdp.protocol_desc, + 'url', sdp.protocol_url, + 'type', t_nomenclatures.cd_nomenclature) AS protocols + FROM gn_meta.cor_dataset_protocol cdp + JOIN gn_meta.sinp_datatype_protocols sdp + ON cdp.id_protocol = sdp.id_protocol + LEFT JOIN ref_nomenclatures.t_nomenclatures + ON sdp.id_nomenclature_protocol_type = t_nomenclatures.id_nomenclature) + , ds AS (SELECT tds.id_dataset, tds.id_acquisition_framework, -- tds.additional_data, jsonb_build_object('uuid', tds.unique_dataset_id, 'name', tds.dataset_name, 'desc', tds.dataset_desc, 'shortname', tds.dataset_shortname, 'data_type', ndt.cd_nomenclature, - 'collecting_method', ncm.cd_nomenclature, 'data_origin', ndo.cd_nomenclature, + 'keywords', tds.keywords, 'marine_domain', tds.marine_domain, + 'terrestrial_domain', tds.terrestrial_domain, 'collecting_method', + ncm.cd_nomenclature, 'protocols', + ds_protocols.protocols, + 'data_origin', ndo.cd_nomenclature, 'dataset_objectif', ndso.cd_nomenclature, 'resource_type', nrt.cd_nomenclature, 'source_status', nss.cd_nomenclature, 'territories', array_agg(DISTINCT ref_nomenclatures.get_cd_nomenclature(cdt.id_nomenclature_territory)), @@ -122,6 +140,7 @@ WITH af_actors AS (SELECT cafa.id_acquisition_framework, FROM gn_meta.t_datasets tds JOIN ds_actors ON ds_actors.id_dataset = tds.id_dataset LEFT JOIN gn_meta.cor_dataset_territory cdt ON cdt.id_dataset = tds.id_dataset + LEFT JOIN ds_protocols ON ds_protocols.id_dataset = tds.id_dataset LEFT JOIN ref_nomenclatures.t_nomenclatures ndt ON tds.id_nomenclature_data_type = ndt.id_nomenclature LEFT JOIN ref_nomenclatures.t_nomenclatures ncm @@ -136,7 +155,8 @@ WITH af_actors AS (SELECT cafa.id_acquisition_framework, ON tds.id_nomenclature_source_status = nss.id_nomenclature GROUP BY tds.id_dataset, tds.id_acquisition_framework, tds.unique_dataset_id, tds.dataset_name, tds.dataset_desc, tds.dataset_shortname, ndt.cd_nomenclature, ncm.cd_nomenclature, - ndo.cd_nomenclature, ndso.cd_nomenclature, nrt.cd_nomenclature, nss.cd_nomenclature) + ndo.cd_nomenclature, ndso.cd_nomenclature, nrt.cd_nomenclature, nss.cd_nomenclature, + ds_protocols.protocols) SELECT s.id_synthese, s.entity_source_pk_value AS id_source, s.unique_id_sinp AS id_perm_sinp, From 331bf318e593fef793e9924bda955b62d9d751c9 Mon Sep 17 00:00:00 2001 From: lpofredc Date: Tue, 20 Aug 2024 15:35:34 +0200 Subject: [PATCH 10/10] fix pagination calculation (fix #81) --- CHANGELOG.md | 8 +++++++- gn2pg/api.py | 11 +++++++---- gn2pg/metadata.py | 2 +- pyproject.toml | 2 +- tests/test_api.py | 3 ++- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b0342..764b16e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this +## 1.6.5 - 2024-08-20 + +### Fixes + +- Pagination is now calculated from API response (`limit` value), fix #81 + ## 1.6.4 - 2024-04-24 -## Fixes +### Fixes - Fix typo error on trigger scripts. diff --git a/gn2pg/api.py b/gn2pg/api.py index b58f5f5..3368f9d 100644 --- a/gn2pg/api.py +++ b/gn2pg/api.py @@ -137,7 +137,7 @@ def controler(self) -> Optional[str]: """Return the controler name.""" return self._ctrl - def _url(self, kind: str = "data", params: Optional[dict] = None) -> Optional[str]: + def _url(self, kind: str = "data", params: Optional[dict] = None) -> str: """Generate export API URL with QueryStrings if params. Args: @@ -180,7 +180,7 @@ def page_list( api_url = self._url(kind, params) - response = session.get(url=api_url, params={**params, **{"limit": 1}}) + response = session.get(url=api_url, params={**params}) logger.debug( _("Defining page_list from %s with status code %s"), api_url, @@ -190,7 +190,8 @@ def page_list( if response.status_code == 200: resp = response.json() total_filtered = resp["total_filtered"] if "total_filtered" in resp else resp["total"] - total_pages = math.ceil(total_filtered / params.get("limit")) + limit = resp["limit"] + total_pages = math.ceil(total_filtered / limit) logger.debug( _("API %s contains %s data in %s page(s)"), api_url, @@ -198,7 +199,9 @@ def page_list( total_pages, ) - page_list = (self._url(kind, {**params, **{"offset": p}}) for p in range(total_pages)) + page_list = list( + self._url(kind, {**params, **{"offset": p}}) for p in range(total_pages) + ) return page_list logger.info(_("No data available from from %s"), self._config.name) return None diff --git a/gn2pg/metadata.py b/gn2pg/metadata.py index d98d6c7..576cc1c 100644 --- a/gn2pg/metadata.py +++ b/gn2pg/metadata.py @@ -8,7 +8,7 @@ PACKAGE = "gn2pg_client" PROJECT = "GeoNature 2 PostgreSQL Client application" PROJECT_NO_SPACES = PROJECT.replace(" ", "") -VERSION = "1.6.4" +VERSION = "1.6.5" DESCRIPTION = "Import tool from GeoNature to a PostgreSQL database through Export module API" AUTHORS = [ "@lpofredc (LPOAuRA)", diff --git a/pyproject.toml b/pyproject.toml index 1d73062..0b3f52b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "gn2pg_client" packages = [{ include = "gn2pg" }] -version = "1.6.4" +version = "1.6.5" description = "Import tool from GeoNature to a PostgreSQL database through Export module API (client side)" authors = ["lpofredc "] maintainers = ["lpofredc "] diff --git a/tests/test_api.py b/tests/test_api.py index 18e440b..fd43725 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -20,7 +20,8 @@ def test_page_list(self, base_api): r = base_api._session.get(url=api_url) resp = r.json() total_filtered = resp["total_filtered"] - total_pages = math.ceil(total_filtered / params.get("limit")) + limit = resp["limit"] + total_pages = math.ceil(total_filtered / limit) page_gen = base_api.page_list(params=params)