From 7ae406207affcca8f1a0758eefc81a3aef039d48 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Wed, 15 Sep 2021 11:00:29 -0400 Subject: [PATCH] fix for --datastore-fields w/localckan when datastore table missing --- ckanapi/datapackage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ckanapi/datapackage.py b/ckanapi/datapackage.py index e500d59..4f57a84 100644 --- a/ckanapi/datapackage.py +++ b/ckanapi/datapackage.py @@ -6,7 +6,7 @@ import slugify from ckanapi.cli.utils import pretty_json -from ckanapi.errors import CKANAPIError +from ckanapi.errors import CKANAPIError, NotFound DL_CHUNK_SIZE = 100 * 1024 DATAPACKAGE_TYPES = { # map datastore types to datapackage types @@ -129,7 +129,9 @@ def populate_datastore_res_fields(ckan, res): 'resource_id': res['id'], 'limit':0}) except CKANAPIError: - pass + return + except NotFound: + return # with localckan we'll get the real CKAN exception not a CKANAPIError subclass res['datastore_fields'] = ds['fields']