Commit 0e1610dd authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

Forced ignoring Pandas warning for non-SQLAlchemy Connection

parent aaa543c8
Pipeline #46813 passed with stage
in 1 minute and 39 seconds
......@@ -21,6 +21,7 @@ import numpy
import shapely
import pandas
import geopandas
import warnings
from gdeimporter.tools.database import Database
......@@ -390,12 +391,17 @@ class DatabaseQueries:
db_obm_buildings = Database(**db_obm_buildings_config)
db_obm_buildings.create_connection_and_cursor()
obm_buildings = geopandas.GeoDataFrame.from_postgis(
sql_query % (db_table, "4326", geographic_area, occupancy_types_condition),
db_obm_buildings.connection,
geom_col="geometry",
crs="epsg:4326",
)
with warnings.catch_warnings():
# Ignore warning for non-SQLAlchemy Connection
# (see github.com/pandas-dev/pandas/issues/45660)
warnings.simplefilter("ignore", UserWarning)
obm_buildings = geopandas.GeoDataFrame.from_postgis(
sql_query % (db_table, "4326", geographic_area, occupancy_types_condition),
db_obm_buildings.connection,
geom_col="geometry",
crs="epsg:4326",
)
db_obm_buildings.close_connection()
......
Spain
Turkey
Switzerland
Germany
\ No newline at end of file
......@@ -100,7 +100,7 @@ def test_Configuration_interpret_exposure_entities_to_run(test_db):
returned_config.interpret_exposure_entities_to_run()
assert len(returned_config.exposure_entities_to_run) == 3
assert returned_config.exposure_entities_to_run[0] == "ESP"
assert returned_config.exposure_entities_to_run[1] == "TUR"
assert returned_config.exposure_entities_to_run[1] == "CHE"
assert returned_config.exposure_entities_to_run[2] == "DEU"
# A name of a CSV file is provided, 'exposure_entities_code' is ISO3
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment