You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yep, great idea. I always thought about ingested packages as something uncontrolled that comes from the outside world.
But a combination of local data with ingested information definitely a common usecase, so patch instead of update is a must-have feature at least:
for your scenario, when ingestion should update specific field, and keep anything that already exists in dataset and missing from ingestion info
situation, when user adds resources to the ingested package and don't won't this resources to be removed after re-ingestion.
The current behavior with unconditional reset to some specific state of the dataset is also sensible in certain scenarios(in my projects, at least:)), so I'll keep this option.
I'll probably add the following change for now:
action="package_"+ (
"update"ifpkgandself.options.get("update_existing") else"create"
)
# will be changed to => update_strategy=self.options.get("update_strategy", "update")
action="package_"+ (
update_strategyifpkgandself.options.get("update_existing") else"create"
)
To keep it compatible with existing code. Everything remains unchanged by default, and you can set update_strategy: "patch" record option to use package/resource patch
For the v2 of the extension, I'll think of a better interface.
I had unexpected loss of all resources from a project while building an ingestion pipeline that could update the dataset metadata. Turns out there is a
patch
variant of package and resource update: https://docs.ckan.org/en/2.9/api/#ckan.logic.action.update.package_updateMight be worth changing the update to be non-destructive, or introduce a multi-state (enum) parameter:
ckanext-ingest/ckanext/ingest/record.py
Lines 38 to 40 in e6df1ff
ckanext-ingest/ckanext/ingest/record.py
Lines 96 to 100 in e6df1ff
Thanks
The text was updated successfully, but these errors were encountered: