Skip to content

[Bug] Uploading a datapackage with Uppercase letters or spaces deletes attribute definition on api.PATCH #26

@mwallschlaeger

Description

@mwallschlaeger

When uploading a datapackage like in https://github.com/GeoNodeUserGroup-DE/contrib_datapackage/blob/main/importer_datapackage/handlers/datapackage/data/datapackage.json, the "name" of each field from the datapackage.json will be used as name of the attribute in GeoNode. On the other hand when this attribute names etc. get uploaded to geoserver, this values get transfered to lowercases and spaces get transformed into _.

This leads to the Bug when e.g. patching a tabular dataset using e.g. the API, attribute descriptions get deleted, because geonode cannot match attributes synced from geoserver with the stored attribute names inside the Attributes model.

overwrite happens in when syncing with gesoserver at this helper file:
https://github.com/GeoNode/geonode/blob/842fc8870017988b5c8a22289d75fbd9420a7127/geonode/geoserver/helpers.py#L934

To reproduce this bug:

  1. upload valid_data.zip
  • geonodectl ds upload -f importer_datapackage/handlers/datapackage/data/valid_data.zip
  1. patch dataset in any case
  • geonodectl ds patch 1 --set '{ "title": "test" }'
  1. validate attribute table of dastaset

Metadata

Metadata

Labels

52nbugSomething isn't workingdocumentationImprovements or additions to documentation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions