Skip to content

Se mezclan los archivos generados #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Se mezclan los archivos generados #18

wants to merge 4 commits into from

Conversation

germankay
Copy link
Collaborator

fixes #17

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that updating the iati_base_resource_id extra preserves any other existing extras and refines how datasets are queried for that extra.

  • Merge or replace the iati_base_resource_id extra without discarding other extras when patching a package.
  • Switch the dataset search to use CKAN’s fq filter and add debug logging for each found dataset.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ckanext/iati_generator/blueprint/iati.py Merge new iati_base_resource_id into existing extras instead of overwriting them.
ckanext/iati_generator/actions/iati.py Change package_search to use fq filter and log each dataset found.
Comments suppressed due to low confidence (1)

ckanext/iati_generator/blueprint/iati.py:68

  • [nitpick] This comment is in Spanish and includes an emoji; consider translating it to English and removing informal markers for consistency with the codebase’s style.
# 🛠 Reemplazar o agregar el extra sin perder los anteriores

search_result = toolkit.get_action("package_search")(context, {
"q": "extras_iati_base_resource_id:[* TO *]",
result = toolkit.get_action("package_search")(context, {
"fq": "iati_base_resource_id:*",
Copy link
Preview

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

CKAN indexes extras under extras_<key>, so the filter should likely be extras_iati_base_resource_id:* instead of iati_base_resource_id:* to return the correct datasets.

Suggested change
"fq": "iati_base_resource_id:*",
"fq": "extras_iati_base_resource_id:*",

Copilot uses AI. Check for mistakes.

@avdata99
Copy link
Member

avdata99 commented Jun 5, 2025

Some notes:

  • Search for examples of how to create resources by uploading the file. It should not be necessary to store in the storage_path (resource_id[:3], resource_id[3:6] should not be used). CKAN should take care of saving the XML file where it belongs.
  • Analyze whether to use extra resources or extra packages. It will be better to use resource extras because it is more straightforward and less confusing. There could be a dataset with multiple resources to transform into IATI and if the extras are at the beginning of the dataset, it will fail.

@germankay germankay changed the title Se mezclan los archivos generados IN PROGRES Se mezclan los archivos generados Jun 18, 2025
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.

Revisar que no se mezclen
2 participants