Conversation
|
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. |
|
The CLA was sent to info@osgeo.org |
mattiagiupponi
left a comment
There was a problem hiding this comment.
Hi @ostyhar
I dont agree much with the implementation, i would suggest to approach it in a different way:
- the main issue since the parameters is
skip_existing_layerinstead of the one in the serializerskip_existing_layersi agree that we should do it, but I think the change should be done on theextract_params_from_datafor 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 - 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_importedinto the_select_valid_layerswhich 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 theimport_resourcethere are not valid layers, so then the execution stops.
|
@mattiagiupponi , got it. I moved the flag handling into Just one thing I'm not sure about: when Should this case finish successfully with 0 imported resources, or should it fail? And should raster and 3D Tiles behave the same way when everything is skipped? |
|
Hey @ostyhar!
What do you think? |
|
I would rather display a more informative message rather the criptic "The skip_existing_layers was enabled". Something like:
|
|
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. |
|
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. |
|
@mattiagiupponi , @giohappy , I've updated my branch. Check it please. |
|
Thanks @ostyhar . I'm not sure we'll be able to review it very soon, but I've started the test runs meanwhile. |
mattiagiupponi
left a comment
There was a problem hiding this comment.
Overall looks good, just a note on my side @ostyhar
| """ | ||
| gdal_proxy = self.open_source_file(files) | ||
| layers = self._select_valid_layers(gdal_proxy, execution_id=execution_id) | ||
| layers = self._select_valid_layers(gdal_proxy, execution_id=execution_id, filter_existing=True) |
There was a problem hiding this comment.
The filter_existing should not come from the extracted parameter?
|
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. |
|
@mattiagiupponi , I've updated the branch. Check it please. |
Fixes #14377.
The upload API exposes
skip_existing_layers, while the importer checksskip_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
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
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.