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 606823874,MDExOlB1bGxSZXF1ZXN0NDA4OTQ3MjQ0,4006,fix dangerous default arguments,40136154,closed,0,,,3,2020-04-25T18:05:11Z,2020-05-23T17:41:56Z,2020-05-23T17:30:51Z,CONTRIBUTOR,,0,pydata/xarray/pulls/4006," - [x] Closes #4002 - [ ] Passes `isort -rc . && black . && mypy . && flake8` - [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4006/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 606549469,MDU6SXNzdWU2MDY1NDk0Njk=,4002,Remove dangerous default argument,40136154,closed,0,,,16,2020-04-24T19:58:59Z,2020-05-23T17:30:51Z,2020-05-23T17:30:51Z,CONTRIBUTOR,,,," Hi, It is good not to use the default arguments while calling a function. #### MCVE Code Sample In file `xarray/tests/test_conventions.py` ```python # Your code here 329 @contextlib.contextmanager 330 def roundtrip( 331 self, data, save_kwargs={}, open_kwargs={}, allow_cleanup_failure=False332 ): 333 store = CFEncodedInMemoryStore() 334 data.dump_to_store(store, **save_kwargs) ``` #### Problem Description Default arguments in Python are evaluated once when the function definition is executed. This means that the expression is evaluated only once when the function is defined and that the same value is used for each subsequent call. So if you are modifying the mutable default argument — a list, dict, etc., it will be modified for all future calls. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4002/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 613516581,MDExOlB1bGxSZXF1ZXN0NDE0MjU1NDg3,4038,Use literal syntax instead of function calls to create the data structure,40136154,closed,0,,,1,2020-05-06T18:17:40Z,2020-05-06T22:55:40Z,2020-05-06T22:55:40Z,CONTRIBUTOR,,0,pydata/xarray/pulls/4038," - [x] Passes `isort -rc . && black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API --- It is slower to call e.g. `list()` than using the empty literal, because the name list must be looked up in the global scope in case it has been rebound. Same for the other two types like `dict()` and `tuple()`.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4038/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 605921766,MDExOlB1bGxSZXF1ZXN0NDA4MjM4MDUw,3999,Fix some code quality and bug-risk issues,40136154,closed,0,,,3,2020-04-23T22:46:31Z,2020-05-05T02:21:12Z,2020-04-24T07:14:55Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3999,"- Fix dangerous default argument - Remove unnecessary comprehension --- Find the other issues found here - [https://deepsource.io/gh/pnijhara/xarray/issues/?category=all](https://deepsource.io/gh/pnijhara/xarray/issues/?category=all) This PR also adds `.deepsource.toml` configuration file to run DeepSource analysis on the repo with. Upon enabling DeepSource, the analysis will run on every PR and commit to detect 560+ types of issues in the changes — including bug risks, anti-patterns, security vulnerabilities, etc. To enable DeepSource analysis after merging this PR, please follow these steps: 1. [Signup](https://deepsource.io/signup/) on DeepSource with your GitHub account and grant access to this repo. 2. Activate analysis on this repo [here](http://deepsource.io/gh/pydata/xarray) You can also look at the [docs](https://deepsource.io/docs/guides/quickstart.html) for more details. Do let me know if I can be of any help! ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3999/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 611850402,MDExOlB1bGxSZXF1ZXN0NDEyOTMxNjc1,4026,chore: Remove unnecessary comprehension,40136154,closed,0,,,5,2020-05-04T12:49:41Z,2020-05-05T01:57:32Z,2020-05-05T01:57:31Z,CONTRIBUTOR,,0,pydata/xarray/pulls/4026," - [x] Passes `isort -rc . && black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4026/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 606822020,MDExOlB1bGxSZXF1ZXN0NDA4OTQ1ODk4,4005,Fix dangerous default argument,40136154,closed,0,,,0,2020-04-25T17:55:07Z,2020-04-25T17:58:24Z,2020-04-25T17:55:32Z,CONTRIBUTOR,,0,pydata/xarray/pulls/4005," - [x] Closes #4002 - [ ] Tests added - [ ] Passes `isort -rc . && black . && mypy . && flake8` - [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4005/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull