Skip to content

[Fixes #14377] Honor skip_existing_layers flag - #14597

Open
ostyhar wants to merge 1 commit into
GeoNode:masterfrom
ostyhar:fix/14377-skip-existing-layers
Open

ostyhar wants to merge 1 commit into
GeoNode:masterfrom
ostyhar:fix/14377-skip-existing-layers

Conversation

@ostyhar

@ostyhar ostyhar commented Sep 14, 2026

Copy link
Copy Markdown

Fixes #14377.

The upload API exposes skip_existing_layers, while the importer checks skip_existing_layer. This change normalizes the flag before the execution request is created and adjusts the expected layer count when existing layers are skipped.

It also fixes the raster and 3D Tiles skip paths and adds regression tests for full and partial skips.

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.

The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):

  • There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
  • The issue connected to the PR must have Labels and Milestone assigned
  • PR for bug fixes and small new features are presented as a single commit
  • PR title must be in the form "[Fixes #<issue_number>] Title of the PR"
  • New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.

@cla-bot

cla-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @ostyhar on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

@ostyhar

ostyhar commented Sep 14, 2026

Copy link
Copy Markdown
Author

The CLA was sent to info@osgeo.org

@mattiagiupponi
mattiagiupponi self-requested a review September 14, 2026 13:53
@mattiagiupponi mattiagiupponi self-assigned this Sep 14, 2026
@mattiagiupponi mattiagiupponi added this to the 5.2.0 milestone Sep 14, 2026

@mattiagiupponi mattiagiupponi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ostyhar
I dont agree much with the implementation, i would suggest to approach it in a different way:

  1. the main issue since the parameters is skip_existing_layer instead of the one in the serializer skip_existing_layers i agree that we should do it, but I think the change should be done on the extract_params_from_data for each handler rather than an IF in the view. Understandable that at least is common for everyone, but goes againts the principle to have each handler responsible for the preparation of the parameters required for the execution
  2. Rather than leaving the funciton as it is and move logic in the datastore to evaluate the execution, since we want to skip some dataset, i suggest to move the control should_be_imported into the _select_valid_layers which checks if the layers are valid. Ofc if i need to skip it is not valid, then should be removed from the selected valid layers. We can add a log into the function to evaluate it. In this way when it reaches the import_resource there are not valid layers, so then the execution stops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip_existing_layers is documented in the upload API as functional but the code says otherwise

2 participants