Consistent rules for handling merges between variables with different attributes · Issue #25 · pydata/xarray (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Currently, variable attributes are checked for equality before allowing for a merge via a call to xarray_equal
. It should be possible to merge datasets even if some of the variable metadata disagrees (conflicting attributes should be dropped). This is already the behavior for global attributes.
The right design of this feature should probably include some optional argument to Dataset.merge
indicating how strict we want the merge to be. I can see at least three versions that could be useful:
- Drop conflicting metadata silently.
- Don't allow for conflicting values, but drop non-matching keys.
- Require all keys and values to match.
We can argue about which of these should be the default option. My inclination is to be as flexible as possible by using 1 or 2 in most cases.