Add ability to deprecate names of raw data fields.#2198
Draft
aaronweeden wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, if a raw data field is renamed or removed, it can break Python scripts and notebooks that use its name.
This PR adds the ability to mark a raw data field as deprecated so that the
xdmod-dataAPI can post aFutureWarningif a user tries to use it (functionality added toxdmod-datain ubccr/xdmod-data#91) rather than an exception being thrown.#2026 renames the raw data field
OrganizationtoUser Institution, so this PR marksOrganizationas a deprecated name of it. Below is a screenshot of what theFutureWarningwill look like if someone tries to use it:So, to use the new functionality to deprecate a name of a field, add a
deprecatedNamesproperty whose value is an array containing the name.There are also cases where a field is not being renamed but is instead being removed. [Upcoming xdmod-xsede PR] has examples of these. In this case, simply add a
"deprecated": trueproperty to the field and update the field's description to explain what the user should do. ubccr/xdmod-data#91 adds functionality toxdmod-datato grab the description, remove any leading stringDEPRECATED:, and include it in theFutureWarning. Below is an example screenshot of this.The new
deprecatedanddeprecatedNamesproperties are not used anywhere else in the portal, so this does not change any other existing functionality.Tests performed
Checklist: