Skip to content

Commit

Permalink
Remove deprecated key db_table from GET Ws Layer response
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Jan 6, 2025
1 parent 87eaf57 commit ac92d5e
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- key `file_type` was removed from endpoints GET [Publications](doc/rest.md#get-publications)/[Layers](doc/rest.md#get-layers)/[Workspace Layers](doc/rest.md#get-workspace-layers)/[Workspace Maps](doc/rest.md#get-workspace-maps)/[Maps](doc/rest.md#get-maps)/[Workspace Layer](doc/rest.md#get-workspace-layer)/[Workspace Map](doc/rest.md#get-workspace-map) response
- key `file`.`path` was removed from GET [Workspace Layer](doc/rest.md#get-workspace-layer) response
- key `sld` was removed from GET [Workspace Layer](doc/rest.md#get-workspace-layer) response
- key `db_table` was removed from GET [Workspace Layer](doc/rest.md#get-workspace-layer) response
- body parameter `sld` for [POST Workspace Publications](doc/rest.md#post-workspace-layers) and [PATCH Workspace Publication](doc/rest.md#patch-workspace-layer)
- [#1028](https://github.com/LayerManager/layman/issues/1028) Upgrade Node.js of Laymen Test Client from v18 to v22 and dependencies:
- eslint-config-next 13 -> 14
Expand Down
5 changes: 0 additions & 5 deletions doc/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,6 @@ JSON object with following structure:
- *external_uri*: String. Available only for layers published from external table. Connection string to external table without password.
- *status*: Status information about DB import and availability of the table. See [GET Workspace Layer](#get-workspace-layer) **wms** property for meaning.
- *error*: If status is FAILURE, this may contain error object.
- *~~db_table~~*: **Deprecated**. Replaced by **db**.
- available only for vector layers
- *~~name~~*: Replaced by db.table.
- *~~status~~*: Replaced by db.status.
- *~~error~~*: Replaced by db.error.
- **style**
- *url*: String. URL of layer default style. It points to [GET Workspace Layer Style](#get-workspace-layer-style).
- *type*: String. Type of used style. Either 'sld' or 'qml'.
Expand Down
2 changes: 1 addition & 1 deletion src/layman/layer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def get_layer_patch_keys():
(settings.GEODATA_TYPE_VECTOR, settings.EnumOriginalDataSource.FILE.value): {
'name', 'uuid', 'layman_metadata', 'url', 'title', 'description', 'updated_at', 'wms', 'wfs', 'thumbnail', 'file',
'db', 'metadata', 'style', 'access_rights', 'bounding_box', 'native_crs', 'native_bounding_box',
'original_data_source', 'geodata_type', 'db_table',
'original_data_source', 'geodata_type',
},
(settings.GEODATA_TYPE_VECTOR, settings.EnumOriginalDataSource.TABLE.value): {
'name', 'uuid', 'layman_metadata', 'url', 'title', 'description', 'updated_at', 'wms', 'wfs', 'thumbnail',
Expand Down
4 changes: 0 additions & 4 deletions src/layman/layer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ def _get_complete_layer_info(workspace, layername, *, x_forwarded_items=None):
'title': layername,
'description': '',
})
if original_data_source == settings.EnumOriginalDataSource.FILE.value and partial_info.get('db', {}).get('table') is not None:
partial_info['db_table'] = {
'name': partial_info['db']['table'],
}

complete_info.update(partial_info)
file_type = complete_info.get('_file', {}).get('file_type')
Expand Down
1 change: 0 additions & 1 deletion src/layman/rest_responses_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class TestResponsesClass:
'bounding_box': list(test_data.SMALL_LAYER_BBOX),
'native_crs': 'EPSG:4326',
'native_bounding_box': list(test_data.SMALL_LAYER_NATIVE_BBOX),
'db_table': {'name': None},
'db': {'schema': workspace,
'table': None,
'geo_column': 'wkb_geometry',
Expand Down
2 changes: 1 addition & 1 deletion tests/asserts/final/publication/internal_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def same_values_in_internal_and_rest(workspace, publ_type, name, rest_publicatio

# adjust rest_publication_detail, see get_complete_(layer|map)_info
rest_publication_detail = copy.deepcopy(rest_publication_detail)
for key in ('layman_metadata', 'url', 'db_table'):
for key in ('layman_metadata', 'url'):
rest_publication_detail.pop(key, None)

if 'image_mosaic' not in rest_publication_detail:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ def test_internal_layer(self, layer: Publication):
rest_info_pre = process_client.get_workspace_layer(layer.workspace, layer.name)

table_name = f"layer_{rest_info_pre['uuid'].replace('-', '_')}"
assert rest_info_pre['db_table'] == {
'name': table_name
}
assert rest_info_pre['db'] == {
'schema': layer.workspace,
'table': table_name,
Expand All @@ -51,9 +48,6 @@ def test_internal_layer(self, layer: Publication):

rest_info_post = process_client.get_workspace_layer(layer.workspace, layer.name)

assert rest_info_post['db_table'] == {
'status': 'NOT_AVAILABLE',
}
assert rest_info_post['db'] == {
'status': 'NOT_AVAILABLE',
}
Expand Down

0 comments on commit ac92d5e

Please sign in to comment.