Skip to content

Add ability to deprecate names of raw data fields.#2198

Draft
aaronweeden wants to merge 3 commits into
ubccr:mainfrom
aaronweeden:enable-deprecating-raw-field-names
Draft

Add ability to deprecate names of raw data fields.#2198
aaronweeden wants to merge 3 commits into
ubccr:mainfrom
aaronweeden:enable-deprecating-raw-field-names

Conversation

@aaronweeden
Copy link
Copy Markdown
Contributor

@aaronweeden aaronweeden commented Apr 20, 2026

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-data API can post a FutureWarning if a user tries to use it (functionality added to xdmod-data in ubccr/xdmod-data#91) rather than an exception being thrown.

#2026 renames the raw data field Organization to User Institution, so this PR marks Organization as a deprecated name of it. Below is a screenshot of what the FutureWarning will look like if someone tries to use it:


So, to use the new functionality to deprecate a name of a field, add a deprecatedNames property 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": true property to the field and update the field's description to explain what the user should do. ubccr/xdmod-data#91 adds functionality to xdmod-data to grab the description, remove any leading string DEPRECATED: , and include it in the FutureWarning. Below is an example screenshot of this.


The new deprecated and deprecatedNames properties are not used anywhere else in the portal, so this does not change any other existing functionality.

Tests performed

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant