Skip to content

Conversation

@hendrikmakait
Copy link
Member

@hendrikmakait hendrikmakait commented Aug 1, 2022

Partially addresses pre-commit failures in #6809

  • Tests added / passed
  • Passes pre-commit run --all-files

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

       15 files  ±0         15 suites  ±0   6h 31m 28s ⏱️ + 4m 10s
  2 983 tests ±0    2 892 ✔️ +3       87 💤 ±0  3  - 2  1 🔥  - 1 
22 114 runs  ±0  21 079 ✔️ +4  1 028 💤 ±0  6  - 3  1 🔥  - 1 

For more details on these failures and errors, see this check.

Results for commit 7ddf588. ± Comparison against base commit 9267a21.

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hendrikmakait. The actual code changes here look fine to me. I do wonder if this is a bit too much and something we want to just continue to ignore. Is this just to cut down on function calls?

@hendrikmakait
Copy link
Member Author

@jrbourbeau:
These changes are based on rule B008 from flake8-bugbear:

B008: Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
-- (https://github.com/PyCQA/flake8-bugbear#list-of-warnings)

Similar to avoiding mutable defaults in function arguments (B006), I think we'd benefit from enforcing this rule to avoid footguns. When it comes to these particular lines, I'd also be fine with adding a # noqa: B008 in-line comment.

Copy link
Member

@fjetter fjetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with the changes. I don't think there is need to add any ignore statements.

@fjetter fjetter merged commit 602148f into dask:main Aug 8, 2022
hendrikmakait added a commit to hendrikmakait/distributed that referenced this pull request Aug 8, 2022
gjoseph92 pushed a commit to gjoseph92/distributed that referenced this pull request Oct 31, 2022
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.

3 participants