New defaults for concat
, merge
, combine_*
#10062
Draft
+973
−260
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.
Replaces #10051
FutureWarnings
whats-new.rst
api.rst
This PR attempts to throw warnings if and only if the output would change with the new kwarg defaults. To exercise the new default I am toggling the option back and forth and running the existing test suite.
Run all the tests with
use_new_combine_kwarg_defaults=True
270 failed
Change to
use_new_combine_kwarg_defaults=False
and run the last failed:268 failed, 2 passed
Those 2 are missed alarms (behavior will be different when using new kwargs and we are not warning). But I am not totally sure whether we need to handle them because they are tests for conditions that used to raise an error and with the new defaults they do not.
Running all the tests with
use_new_combine_kwarg_defaults=False
352 failed
Change to
use_new_combine_kwarg_defaults=True
and run the last failed:268 failed, 86 passed
Those 86 are false alarms
Here is a list of them
About half of them are triggered by my attempt to catch cases where different datasets have matching overlapping variables and with
compat='no_conflicts'
you might be different results than withcompat='override'
. There might be a better way, but we want to be careful to avoid calling compute.TODO:
3) Alter existing tests to make sure they still test what they were meant to test by passing in any required kwargs
4) Add new tests that explicitly ensure that for a bunch of different inputs, using old defaults throws a warning OR output is the same with new and old defaults.
Notes
None
to indicate a kwarg value that the user has not explicitly set, but it might be preferable to instead use a special indicator value so you can't actually set the kwargs to None. The benefit of using that approach is that it makes it more obvious that people should not be setting these kwargs to None in their own code. Also with that approach it might be possible to encode both the old and the new default value in the function signature so we don't need to pass around as much context in other kwargs.