From 84a8ca44c3b55ed0e8ad3f5a94c14330de9dd63a Mon Sep 17 00:00:00 2001 From: Irwan Fathurrahman Date: Mon, 6 Jan 2025 13:11:52 +0700 Subject: [PATCH] Close connection of geopandas (#19) * Close connection of geopandas * Fix github workflow --- .github/workflows/tests.yaml | 2 +- django_project/cloud_native_gis/utils/geopandas.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 160b24e..efafbf1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,7 +15,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.9.20 architecture: x64 - name: Checkout PyTorch uses: actions/checkout@master diff --git a/django_project/cloud_native_gis/utils/geopandas.py b/django_project/cloud_native_gis/utils/geopandas.py index 2f0555f..be38ec3 100644 --- a/django_project/cloud_native_gis/utils/geopandas.py +++ b/django_project/cloud_native_gis/utils/geopandas.py @@ -32,8 +32,6 @@ def shapefile_to_postgis(filepath, table_name, schema_name) -> dict: **connection.settings_dict ) engine = create_engine(con) - # TODO: - # Fix this makes test database can't be deleted gdf.to_postgis(table_name, con=engine, schema=schema_name) - + engine.dispose() return metadata