diff --git a/xarray/core/concat.py b/xarray/core/concat.py index f492269b916..67023c800f1 100644 --- a/xarray/core/concat.py +++ b/xarray/core/concat.py @@ -613,7 +613,11 @@ def get_indexes(name): # do not concat if: # 1. variable is only present in one dataset of multiple datasets and # 2. dim is not a dimension of variable - if dim not in variables[0].dims and len(variables) == 1 and len(datasets) > 1: + if ( + dim not in variables[0].dims + and len(variables) == 1 + and len(datasets) > 1 + ): combined_var = variables[0] # only concat if variable is in multiple datasets # or if single dataset (GH1988)