Skip to content
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

Allow implementors to define field order #11

Open
jrdh opened this issue Jul 22, 2019 · 0 comments
Open

Allow implementors to define field order #11

jrdh opened this issue Jul 22, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@jrdh
Copy link
Member

jrdh commented Jul 22, 2019

This comes off the back of NaturalHistoryMuseum/ckanpackager#47.

When importing data into the datastore we store the field order from the source, however, if we don't have any of these details (say, for example, the data was sideloaded directly into mongo and elaticsearch) then we just use the fields from the resource's index mapping in elasticsearch. These fields are ordered alphabetically to maintain some level of consistency.

It'd be nice to allow implementors of the IVersionedDatastore interface to reorder the fields, perhaps:

def datastore_modify_fields(self, resource_id, version, mapping, fields):
    return fields

This allows the implementor to both override the field order and change the fields if they want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant