Skip to content

Add support to ricecooker endpoint for metadata labels.#3407

Merged
rtibbles merged 1 commit intolearningequality:unstablefrom
rtibbles:internal_metadata
Jun 14, 2022
Merged

Add support to ricecooker endpoint for metadata labels.#3407
rtibbles merged 1 commit intolearningequality:unstablefrom
rtibbles:internal_metadata

Conversation

@rtibbles
Copy link
Copy Markdown
Member

@rtibbles rtibbles commented Jun 7, 2022

Summary

Description of the change(s) you made

Adds support to the internal ricecooker endpoint to pass in a list of values for each of the new metadata labels.
Ensures it is a list of items and raises a 400 if not.
Validates the values against the internal constants and raises a 400 if invalid.
Sets the values on the model as a map that keys from the value to True.
Adds tests to the internal views tests to ensure this behaviour.

References

Fixes #3356

@rtibbles rtibbles requested review from bjester and vkWeb June 7, 2022 20:20
Copy link
Copy Markdown
Member

@vkWeb vkWeb left a comment

Choose a reason for hiding this comment

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

Left a small suggestion. The code looks good. Added tests are passing. This can be merged.

freeze_authoring_data=True,
role_visibility=node_data.get('role') or roles.LEARNER,
complete=is_complete,
**metadata_labels
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we be more explicit here by providing kwargs using metadata_labels?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The intention here is to only set the kwargs for each of the metadata_labels keys if they have been set, so I don't think there's another way to do that except to explicitly write <kwarg>=metadata_labels.get("<kwarg>")

@rtibbles rtibbles merged commit e3823d7 into learningequality:unstable Jun 14, 2022
@rtibbles rtibbles deleted the internal_metadata branch June 14, 2022 21:34
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.

Add support to internal.py node endpoint for metadata labels

2 participants