home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 216535655

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
216535655 MDU6SXNzdWUyMTY1MzU2NTU= 1320 BUG: to_netcdf no longer works with file objects when engine='scipy' 1217238 closed 0 1217238 2444330 0 2017-03-23T18:53:18Z 2017-04-13T05:32:59Z 2017-04-13T05:32:59Z MEMBER      

This worked in xarray v0.8.2, but no longer works in v0.9.1: ds.to_netcdf(f, engine='scipy') when f is a file-like object.

The traceback looks like: File "...../xarray/core/dataset.py", line 953, in to_netcdf unlimited_dims=unlimited_dims) File "...../xarray/backends/api.py", line 546, in to_netcdf path = _normalize_path(path) File "...../xarray/backends/api.py", line 51, in _normalize_path if is_remote_uri(path): File "...../xarray/core/utils.py", line 439, in is_remote_uri return bool(re.search('^https?\://', path)) File "...../re.py", line 146, in search return _compile(pattern, flags).search(string) TypeError: expected string or buffer

The problem is that to_netcdf does not check to make sure the path is a string before calling _normalize_path: https://github.com/pydata/xarray/blob/b3fc6c4e4fafdf4f075b791594633970a787ad79/xarray/backends/api.py#L545-L548

For now, it's easy enough to work around this by creating a byte-string with to_netcdf and then writing the file separately, but it would be nice to support writing to the file-like object directly again.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1320/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.622ms · About: xarray-datasette