Skip to content

Conversation

wardi
Copy link
Contributor

@wardi wardi commented Jan 27, 2025

Fix for compatibility with CKAN Table Designer feature

Fix for compatibility with CKAN Table Designer feature
Copy link
Collaborator

@duttonw duttonw left a comment

Choose a reason for hiding this comment

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

Testing is failing for 2.10.x

Provided comment to make it work with both.

# check if the resource url_type is a datastore
if resource.get('url_type') == 'datastore':
logger.info('Ignoring resource - url_type=datastore - dump files are '
if resource.get('url_type') in h.datastore_rw_resource_url_types():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needs backwards support for for 2.10.x since datastore_rw_resource_url_types only exists in 2.11.

https://github.com/ckan/ckan/blob/ckan-2.11.1/ckanext/datastore/helpers.py#L242 (exists since May 2023)
https://github.com/ckan/ckan/blob/ckan-2.10.6/ckanext/datastore/helpers.py (does not include 'datastore_rw_resource_url_types' )

i.e.

if hasattr(h, "datastore_rw_resource_url_types"):
             datastore_rw_resource_url_types = h.datastore_rw_resource_url_types()
else:
             #fallback for 2.10.x or older.
             datastore_rw_resource_url_types = ['datastore']
           
if resource.get('url_type') in datastore_rw_resource_url_types :

@duttonw duttonw merged commit 79f9fdf into master Jan 28, 2025
8 checks passed
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.

3 participants