home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1040590938

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/pull/6276#issuecomment-1040590938 https://api.github.com/repos/pydata/xarray/issues/6276 1040590938 IC_kwDOAMm_X84-Biha 12813228 2022-02-15T17:49:52Z 2022-02-15T17:49:52Z CONTRIBUTOR

Looks like you need to define a open_dataset_parameters class variable if you want to pass on kwargs. I would prefer this but I don't have much experience with the backends, so others opinions may differ @aurghs @alexamici

See for example:

https://github.com/pydata/xarray/blob/8c5c230881d616af32c5a42cca261eb11fce3916/xarray/backends/pseudonetcdf_.py#L107-L111

If you want to keep the named arguments I would probably avoid inspect and just pass kwargs that are not None:

```python kwargs = {"a": 5, "b": None}

only pass on kwargs that are not None -> pydap has some defaults that are not None

kwargs = {key: value for key, value in kwargs.items() if value is not None} ```

@mathause thanks for your comments, I implemented your suggestion using open_dataset_parameters, hope this is sufficient. The code is covered by existing tests (using formerly keyword arg session), but let me know if you think I should add more tests, for the additional arguments.

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