Skip to content

Bug: Generating datapackage from schemas does not include changes from profile #6

Description

@mrshll1001

In the Profiles mechanism, the schema tools will take all the changes defined in a profile directory and create full profile schemas via a JSON merge patch, into the schema directory. It will also then generate a datapackage.json file based on these schemas.

This is not behaving as expected, since some changes made to the schema via the Profile are not reflected in the datapackage.json. This has a knock-on effect for the ERD diagrams for profiles.

This problem also persists when generating a datapackage manually e.g via hsds_schema.py schemas-to-datapackage schemas/ > test.json, so the root cause may be there.

  1. New properties are not reflected in datapackage.json

E.g. adding test to funding.json, and running profile-all --clean with the repo URI will not add test as a field inside the funding entry in datapackage.json. This prevents it from being rendered in the ERD. test is present in the schema/funding.json file, so should be reflected in the datapackage.

  1. Removed properties are not removed from the foreign keys in datapackage.json

Conversely, removed fields are actually removed from the datapackage. The UK profile removes organization_id from funding.json. After running profile-all --clean and opening datapackage.json, it's clear that organization_id is not present inside of resources['funding']/fields. However, it is still referenced inside of resources['funding']/foreignKeys. This causes errors when generating an ERD from the datapackage.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions