mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-20 12:50:47 +08:00
CLN: Remove deprecated PANDAS_NEW_SQL_API check (#442)
Was necessary to support pandas version <0.14, which is no longer supported by geopandas.
This commit is contained in:
committed by
Joris Van den Bossche
parent
5d4a997301
commit
ed2f8b4499
@@ -4,7 +4,7 @@ import fiona
|
||||
|
||||
from geopandas import read_postgis, read_file
|
||||
from geopandas.tests.util import download_nybb, connect, create_db, \
|
||||
PANDAS_NEW_SQL_API, unittest, validate_boro_df
|
||||
unittest, validate_boro_df
|
||||
|
||||
|
||||
class TestIO(unittest.TestCase):
|
||||
@@ -25,9 +25,6 @@ class TestIO(unittest.TestCase):
|
||||
sql = "SELECT * FROM nybb;"
|
||||
df = read_postgis(sql, con)
|
||||
finally:
|
||||
if PANDAS_NEW_SQL_API:
|
||||
# It's not really a connection, it's an engine
|
||||
con = con.connect()
|
||||
con.close()
|
||||
|
||||
validate_boro_df(self, df)
|
||||
@@ -44,9 +41,6 @@ class TestIO(unittest.TestCase):
|
||||
FROM nybb;"""
|
||||
df = read_postgis(sql, con, geom_col='__geometry__')
|
||||
finally:
|
||||
if PANDAS_NEW_SQL_API:
|
||||
# It's not really a connection, it's an engine
|
||||
con = con.connect()
|
||||
con.close()
|
||||
|
||||
validate_boro_df(self, df)
|
||||
@@ -68,5 +62,3 @@ class TestIO(unittest.TestCase):
|
||||
filtered_df_shape = filtered_df.shape
|
||||
assert(full_df_shape != filtered_df_shape)
|
||||
assert(filtered_df_shape == (2, 5))
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from shapely.geometry import Point, Polygon
|
||||
import fiona
|
||||
from geopandas import GeoDataFrame, read_file, GeoSeries
|
||||
from geopandas.tests.util import assert_geoseries_equal, connect, create_db, \
|
||||
download_nybb, PACKAGE_DIR, PANDAS_NEW_SQL_API, unittest, validate_boro_df
|
||||
download_nybb, PACKAGE_DIR, unittest, validate_boro_df
|
||||
|
||||
|
||||
class TestDataFrame(unittest.TestCase):
|
||||
@@ -328,7 +328,7 @@ class TestDataFrame(unittest.TestCase):
|
||||
"""
|
||||
Ensure that the file is written according to the schema
|
||||
if it is specified
|
||||
|
||||
|
||||
"""
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
@@ -425,9 +425,6 @@ class TestDataFrame(unittest.TestCase):
|
||||
sql = "SELECT * FROM nybb;"
|
||||
df = GeoDataFrame.from_postgis(sql, con)
|
||||
finally:
|
||||
if PANDAS_NEW_SQL_API:
|
||||
# It's not really a connection, it's an engine
|
||||
con = con.connect()
|
||||
con.close()
|
||||
|
||||
validate_boro_df(self, df)
|
||||
@@ -444,9 +441,6 @@ class TestDataFrame(unittest.TestCase):
|
||||
FROM nybb;"""
|
||||
df = GeoDataFrame.from_postgis(sql, con, geom_col='__geometry__')
|
||||
finally:
|
||||
if PANDAS_NEW_SQL_API:
|
||||
# It's not really a connection, it's an engine
|
||||
con = con.connect()
|
||||
con.close()
|
||||
|
||||
validate_boro_df(self, df)
|
||||
|
||||
@@ -24,13 +24,6 @@ try:
|
||||
except ImportError:
|
||||
import mock
|
||||
|
||||
try:
|
||||
from pandas import read_sql_table
|
||||
except ImportError:
|
||||
PANDAS_NEW_SQL_API = False
|
||||
else:
|
||||
PANDAS_NEW_SQL_API = True
|
||||
|
||||
|
||||
def download_nybb():
|
||||
""" Returns the path to the NYC boroughs file. Downloads if necessary.
|
||||
|
||||
Reference in New Issue
Block a user