Skip to content

Conversation

@copybara-service
Copy link

@copybara-service copybara-service bot commented May 26, 2021

[xarray-beam] avoid compatibility checks inside _DiscoverTemplate

The default behavior for compat in xarray.combine_nested() is
"no_conflicts", which actually calls the fillna() method on variables
in a loop:

out = variables[0]
for var in variables[1:]:
out = out.fillna(var)

https://github.com/pydata/xarray/blob/55e5b5aaa6d9c27adcf9a7cb1f6ac3bf71c10dea/xarray/core/merge.py#L147-L149

This has quadratic behavior if the variables are stored in dask arrays
(the dask graph gets one element larger after each loop iteration).

@copybara-service copybara-service bot force-pushed the test_375839385 branch 3 times, most recently from f584327 to 9cd5380 Compare May 26, 2021 02:16
The default behavior for compat in xarray.combine_nested() is
"no_conflicts", which actually calls the fillna() method on variables
in a loop:

  out = variables[0]
  for var in variables[1:]:
    out = out.fillna(var)

https://github.com/pydata/xarray/blob/55e5b5aaa6d9c27adcf9a7cb1f6ac3bf71c10dea/xarray/core/merge.py#L147-L149

This has quadratic behavior if the variables are stored in dask arrays
(the dask graph gets one element larger after each loop iteration).

PiperOrigin-RevId: 375846544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant