home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 569810375

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2666#issuecomment-569810375 https://api.github.com/repos/pydata/xarray/issues/2666 569810375 MDEyOklzc3VlQ29tbWVudDU2OTgxMDM3NQ== 1312546 2019-12-30T22:07:30Z 2019-12-30T22:07:30Z MEMBER

And there are a couple places that need updating, even with a dtypes argument to let the user specify things. We also hit this via Dataset.__setitem__

```pytb ~/sandbox/xarray/xarray/core/dataset.py in setitem(self, key, value) 1268 ) 1269 -> 1270 self.update({key: value}) 1271 1272 def delitem(self, key: Hashable) -> None:

~/sandbox/xarray/xarray/core/dataset.py in update(self, other, inplace) 3521 """ 3522 _check_inplace(inplace) -> 3523 merge_result = dataset_update_method(self, other) 3524 return self._replace(inplace=True, **merge_result._asdict()) 3525

~/sandbox/xarray/xarray/core/merge.py in dataset_update_method(dataset, other) 862 other[key] = value.drop_vars(coord_names) 863 --> 864 return merge_core([dataset, other], priority_arg=1, indexes=dataset.indexes)

~/sandbox/xarray/xarray/core/merge.py in merge_core(objects, compat, join, priority_arg, explicit_coords, indexes, fill_value) 550 coerced, join=join, copy=False, indexes=indexes, fill_value=fill_value 551 ) --> 552 collected = collect_variables_and_indexes(aligned) 553 554 prioritized = _get_priority_vars_and_indexes(aligned, priority_arg, compat=compat)

~/sandbox/xarray/xarray/core/merge.py in collect_variables_and_indexes(list_of_mappings) 275 append_all(coords, indexes) 276 --> 277 variable = as_variable(variable, name=name) 278 if variable.dims == (name,): 279 variable = variable.to_index_variable()

~/sandbox/xarray/xarray/core/variable.py in as_variable(obj, name) 105 elif isinstance(obj, tuple): 106 try: --> 107 obj = Variable(*obj) 108 except (TypeError, ValueError) as error: 109 # use .format() instead of % because it handles tuples consistently

~/sandbox/xarray/xarray/core/variable.py in init(self, dims, data, attrs, encoding, fastpath) 306 unrecognized encoding items. 307 """ --> 308 self._data = as_compatible_data(data, fastpath=fastpath) 309 self._dims = self._parse_dimensions(dims) 310 self._attrs = None

~/sandbox/xarray/xarray/core/variable.py in as_compatible_data(data, fastpath) 229 if isinstance(data, np.ndarray): 230 if data.dtype.kind == "O": --> 231 data = _possibly_convert_objects(data) 232 elif data.dtype.kind == "M": 233 data = np.asarray(data, "datetime64[ns]")

~/sandbox/xarray/xarray/core/variable.py in _possibly_convert_objects(values) 165 datetime64 and timedelta64, according to the pandas convention. 166 """ --> 167 return np.asarray(pd.Series(values.ravel())).reshape(values.shape) 168 169

~/sandbox/numpy/numpy/core/_asarray.py in asarray(a, dtype, order) 83 84 """ ---> 85 return array(a, dtype, copy=False, order=order) 86 87

~/sandbox/pandas/pandas/core/series.py in array(self, dtype) 730 "To keep the old behavior, pass 'dtype=\"datetime64[ns]\"'." 731 ) --> 732 warnings.warn(msg, FutureWarning, stacklevel=3) 733 dtype = "M8[ns]" 734 return np.asarray(self.array, dtype) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  398107776
Powered by Datasette · Queries took 0.582ms · About: xarray-datasette