Skip to content

Commit

Permalink
Merge pull request #208 from transparencia-mg/improve-datastore-update
Browse files Browse the repository at this point in the history
Improve datastore update
  • Loading branch information
gabrielbdornas authored Aug 29, 2023
2 parents 2de5072 + 9666ee9 commit a06b15b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
==========

0.1.22 (29/08/2023)
------------------
- Melhora processo de criação/atualização datastore

0.1.21 (07/03/2023)
------------------
- Possibilita atualização de conjuntos privados
Expand Down
5 changes: 4 additions & 1 deletion dpckan/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ def resource_update_datastore_metadata(ckan_instance, resource_id, resource):
pass
else:
dataset_fields = {}
resource_show = ckan_instance.call_action('resource_show', { "id" : resource_id })
resource_id = { "resource_id" : resource_id }
dataset_fields.update(resource_id)
force = { "force" : "True" }
dataset_fields.update(force)
if resource_show['datastore_active']:
ckan_instance.call_action('datastore_delete', dataset_fields)
fields = []
for field in resource.schema.fields:
meta_info = {"label": field.get("title", ""), "notes" : field.get("description", "") , "type_override" : 'text' }
Expand Down Expand Up @@ -389,4 +392,4 @@ def is_uuid(uuid):

def dataset_path(ckan_host, datapackage):
dataset = f"{ckan_host}/dataset/{datapackage.name}"
return dataset
return dataset
2 changes: 1 addition & 1 deletion package_information.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Variáveis criadas para unificar informações entre os arquivos setup.py e docs/conf.py
# Variáveis author, copyright e licence utilizadas para criação/atualização do arquivo LICENCE.txt (rotina Make durante processo de atualização do pacote "make update-package")
name = 'dpckan'
version = '0.1.21'
version = '0.1.22'
author = 'CONTROLADORIA GERAL DO ESTADO DE MINAS GERAIS - CGE/MG'
email_author = '[email protected]'
description = 'Funções para gestão de pacotes de dados no portal dados.mg.gov.br'
Expand Down

0 comments on commit a06b15b

Please sign in to comment.