diff --git a/setup.cfg b/setup.cfg index 0c56365..c53d233 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = tethys_dataset_services -version = 2.2.0 +version = 2.2.1 description = A generic Python interface for dataset services such as GeoServer, CKAN, and HydroShare author = Nathan Swain author_email = nswain@aquaveo.com @@ -43,7 +43,7 @@ install_requires = geoserver-restconfig requests requests_toolbelt - sqlalchemy + sqlalchemy<2 psycopg2-binary [options.packages.find] diff --git a/tethys_dataset_services/engines/geoserver_engine.py b/tethys_dataset_services/engines/geoserver_engine.py index 2635ae5..b6b6515 100644 --- a/tethys_dataset_services/engines/geoserver_engine.py +++ b/tethys_dataset_services/engines/geoserver_engine.py @@ -1400,7 +1400,8 @@ def create_layer_from_postgis_store(self, store_id, table, debug=False): return response_dict def create_sql_view_layer(self, store_id, layer_name, geometry_type, srid, sql, default_style, - geometry_name='geometry', other_styles=None, parameters=None, debug=False): + geometry_name='geometry', other_styles=None, parameters=None, reload_public=False, + debug=False): """ Direct call to GeoServer REST API to create SQL View feature types and layers. @@ -1414,6 +1415,7 @@ def create_sql_view_layer(self, store_id, layer_name, geometry_type, srid, sql, default_style: The name of the default style. Can be a name or a workspace-name combination (e.g.: "name" or "workspace:name"). other_styles: A list of other default style names. Can be a name or a workspace-name combination (e.g.: "name" or "workspace:name"). parameters: A list of parameter dictionaries { name, default_value, regex_validator }. + reload_public: (bool, optional): Reload the catalog using the public endpoint. Defaults to False. debug (bool, optional): Pretty print the response dictionary to the console for debugging. Defaults to False. """ # noqa: E501 # Process identifier @@ -1476,7 +1478,7 @@ def create_sql_view_layer(self, store_id, layer_name, geometry_type, srid, sql, raise exception # Reload before attempting to update styles to avoid issues - self.reload() + self.reload(public=reload_public) # Add styles to new layer self.update_layer_styles( diff --git a/tox.ini b/tox.ini index 23121aa..8e4d288 100644 --- a/tox.ini +++ b/tox.ini @@ -32,6 +32,8 @@ commands = coverage erase [testenv:e2e_gs_tests] +setenv = + SQLALCHEMY_WARN_20 = 1 commands = pytest tests/e2e_tests/geoserver_engine_e2e_tests.py