Skip to content

Commit

Permalink
Merge pull request #105 from lpoaura/dev
Browse files Browse the repository at this point in the history
to v1.7.0
  • Loading branch information
lpofredc authored Feb 24, 2025
2 parents 098f586 + 31aafda commit 991abd5
Show file tree
Hide file tree
Showing 13 changed files with 1,271 additions and 1,136 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
#-----------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repos:
rev: v4.0.1
hooks:
- id: trailing-whitespace
exclude_types: [sql]
- id: end-of-file-fixer
- id: check-toml

Expand Down Expand Up @@ -43,8 +44,8 @@ repos:
]
files: 'gn2pg'

- repo: https://github.com/amureki/pre-commit-pgFormatter
rev: v1.3.0 # Use the sha / tag you want to point at
- repo: https://github.com/lpofredc/pre-commit-pgformatter
rev: 1.0.0 # Use the sha / tag you want to point at
hooks:
- id: pg_format
args: [-b,-f1,-C,-U2,-k,-g,-w80]
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
<!-- ## Unreleased [{version_tag}](https://github.com/opengisch/qgis-plugin-ci/releases/tag/{version_tag}) - YYYY-MM-DD -->


## 1.7.0 - 2024-10-08

### Fixes

- Quick fix for #103, pending a better fix to exclude metadata insertions for rejected data, partially fix #103.
- Various little fixes

## 1.6.9 - 2024-10-08

### Fixes

- TypeError while using new importlib resources, fix #94


## 1.6.8 - 2024-10-08 (unpublished)
## 1.6.8 - 2024-10-08 (unpublished)

...

Expand Down
2 changes: 0 additions & 2 deletions docker-compose.debug.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
gn2pg:
image: gn2pg
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
gn2pg:
image: gn2pg
Expand Down
7 changes: 6 additions & 1 deletion docs/usage/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ Default script to auto populate GeoNature is called "synthese".
gn2pg_cli --custom-script to_gnsynthese <myconfigfile>
```

:::{tip}
:::{note}
You can also replacing synthese script by your own scripts, using file path instead of `to_gnsynthese`.
:::


:::{attention}
When data from GN2PG is inserted into the `geonature.synthese` table using the supplied trigger, existing triggers on geonature.synthese are executed a posteriori and can override data values from the GN2PG source (for example, the id_nomenclature_sensitivity value).
:::
24 changes: 12 additions & 12 deletions docs/usage/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ The data are downloaded from a standardized GeoNature export from the export mod
- Verification of the connection and authentication to the source GeoNature instance.
- Retrieving the URL of the export module (according to the API `/api/gn_commons/modules`)
- Initial full download (option `--full`):
: - Downloading of the first batch of data (number limited by the `limit` parameter of the export, `1000` by default)
- Calculation of the number of pages of the export: `max_offset = int(presp["total_filtered"] / presp["limit"]) - 1`.
- Downloading and uploading in database page by page.
- Downloading of the first batch of data (number limited by the `limit` parameter of the export, `1000` by default)
- Calculation of the number of pages of the export: `max_offset = int(presp["total_filtered"] / presp["limit"]) - 1`.
- Downloading and uploading in database page by page.
- Upload (option `--update`):
: - Retrieving updates (INSERT, UPDATE, DELETE) from source.
- Deleting DELETE data from the database.
- Downloading and UPSERT data.
- Retrieving updates (INSERT, UPDATE, DELETE) from source.
- Deleting DELETE data from the database.
- Downloading and UPSERT data.

## FR

Expand All @@ -22,10 +22,10 @@ Les données sont téléchargées depuis un export standardisé GeoNature à par
- Vérification de la connexion et l'authentification à l'instance GeoNature source
- Récupération de l'URL du module d'export (d'après l'API `/api/gn_commons/modules`)
- Téléchargement complet initial (option `--full`):
: - Téléchargement du premier lot de données (nombre limité par le paramètre `limit` de l'export, `1000` par défaut)
- Calcul du nombre de pages de l'export: `max_offset = int(presp["total_filtered"] / presp["limit"]) - 1`
- Téléchargement et chargement en base de données pages par pages.
- Téléchargement du premier lot de données (nombre limité par le paramètre `limit` de l'export, `1000` par défaut)
- Calcul du nombre de pages de l'export: `max_offset = int(presp["total_filtered"] / presp["limit"]) - 1`
- Téléchargement et chargement en base de données pages par pages.
- Chargement `update`:
: - Récupération des données d'API des mises à jour (INSERT, UPDATE, DELETE).
- Suppression des données DELETE de la base de données
- Téléchargement et UPSERT des données INSERT ou UPDATE
- Récupération des données d'API des mises à jour (`INSERT`, `UPDATE`, `DELETE`).
- Suppression des données `DELETE` de la base de données
- Téléchargement et `UPSERT` des données (`INSERT ... ON CONFLICT ... DO UPDATE`)
5 changes: 2 additions & 3 deletions gn2pg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
import gettext
import logging
import logging.config
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path

import coloredlogs

from importlib.metadata import version

from gn2pg import metadata

try:
DIST_NAME = "gn2pg_client"
__version__ = version(DIST_NAME)
except : # pragma: no cover
except PackageNotFoundError:
__version__ = metadata.VERSION
finally:
del version
Expand Down
Loading

0 comments on commit 991abd5

Please sign in to comment.