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

Create and test write_resource_properties #757

Open
martonvago opened this issue Oct 8, 2024 · 4 comments
Open

Create and test write_resource_properties #757

martonvago opened this issue Oct 8, 2024 · 4 comments
Assignees

Comments

@martonvago
Copy link
Contributor

Signature: write_resource_properties(path: Path, properties: dict) -> Path:

Context: See diagram in the Core Python functions post.

Things to think about:

  • is the behaviour of the existing verify_resource_properties function exactly what we want here?
  • be careful which object exactly (package properties vs resource properties on the package) we're updating when we merge the new resource properties into the old ones
@martonvago martonvago self-assigned this Oct 8, 2024
@martonvago
Copy link
Contributor Author

@lwjohnst86 @signekb This should have occurred to me sooner but: a package can have multiple resources, so when we update/edit a resource, we only want that specific resource changed and not the others, right? For new resources we would still want to check that the resource doesn't already exist.

For this, we would need something unique to identify resources by. Earlier we decided we don't want to save our resource_id (i.e. the folder name) onto the resources in datapackage.json, so we can't really use that. The spec implies that the name field on resources is unique (it makes up foreign key references), so we could use that. Would we be happy with this?

@martonvago
Copy link
Contributor Author

Oh, but we only care about one resource for this iteration. Well, the question still stands I guess 😅

@lwjohnst86
Copy link
Member

The path field in the resource property contains the resource id 😁 so we can parse that!

@martonvago
Copy link
Contributor Author

Oh trueeeee, I forgot, thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants