Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /statique/bulk database session commit #169

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified data/irve-statique.json.gz
Binary file not shown.
Binary file modified data/irve-statique.parquet
Binary file not shown.
9 changes: 8 additions & 1 deletion src/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to

## [Unreleased]

## [0.12.1] - 2024-09-09

### Fixed

- Commit `/statique/bulk` database transaction

## [0.12.0] - 2024-09-05

### Added
Expand Down Expand Up @@ -177,7 +183,8 @@ and this project adheres to

- Implement base FastAPI app

[unreleased]: https://github.com/MTES-MCT/qualicharge/compare/v0.12.0...main
[unreleased]: https://github.com/MTES-MCT/qualicharge/compare/v0.12.1...main
[0.12.1]: https://github.com/MTES-MCT/qualicharge/compare/v0.12.0...v0.12.1
[0.12.0]: https://github.com/MTES-MCT/qualicharge/compare/v0.11.0...v0.12.0
[0.11.0]: https://github.com/MTES-MCT/qualicharge/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/MTES-MCT/qualicharge/compare/v0.9.0...v0.10.0
Expand Down
2 changes: 1 addition & 1 deletion src/api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
[project]
name = "qualicharge"
version = "0.12.0"
version = "0.12.1"

# Third party packages configuration
[tool.coverage.run]
Expand Down
2 changes: 1 addition & 1 deletion src/api/qualicharge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""QualiCharge package root."""

__version__ = "0.12.0"
__version__ = "0.12.1"
4 changes: 3 additions & 1 deletion src/api/qualicharge/api/v1/routers/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ async def bulk(
transaction = session.begin_nested()
try:
importer.save()
transaction.commit()
except (
ProgrammingError,
IntegrityError,
Expand All @@ -293,4 +292,7 @@ async def bulk(
status_code=status.HTTP_404_NOT_FOUND, detail=str(err)
) from err

# Commit changes
session.commit()

return StatiqueItemsCreatedResponse(items=df["id_pdc_itinerance"])