Skip to content

Run dunder method rule on methods directly#9815

Merged
charliermarsh merged 1 commit intomainfrom
charlie/dunder
Feb 4, 2024
Merged

Run dunder method rule on methods directly#9815
charliermarsh merged 1 commit intomainfrom
charlie/dunder

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

This stood out in the flamegraph and I realized it requires us to traverse over all statements in the class (unnecessarily).

@charliermarsh charliermarsh marked this pull request as ready for review February 4, 2024 19:13
@charliermarsh charliermarsh added the internal An internal refactor or improvement label Feb 4, 2024
@charliermarsh charliermarsh merged commit ad01216 into main Feb 4, 2024
@charliermarsh charliermarsh deleted the charlie/dunder branch February 4, 2024 19:24
@charliermarsh charliermarsh added performance Potential performance improvement and removed internal An internal refactor or improvement labels Feb 4, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 1 project error)

sphinx-doc/sphinx (error)

ruff failed
  Cause: Selection of unstable rules without the `--preview` flag is not allowed. Enable preview or remove selection of:
	- FURB113
	- FURB131
	- FURB132

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+3 -3 violations, +0 -0 fixes in 2 projects; 41 projects unchanged)

apache/airflow (+2 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ airflow/providers/databricks/operators/databricks_repos.py:105:9: ANN205 Missing return type annotation for staticmethod `__detect_repo_provider__`
- airflow/providers/databricks/operators/databricks_repos.py:105:9: ANN205 Missing return type annotation for staticmethod `__detect_repo_provider__`
+ airflow/providers/fab/auth_manager/models/__init__.py:81:9: ANN204 Missing return type annotation for special method `__neq__`
- airflow/providers/fab/auth_manager/models/__init__.py:81:9: ANN204 Missing return type annotation for special method `__neq__`

bokeh/bokeh (+1 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ tests/unit/bokeh/core/test_serialization.py:806:17: ANN204 Missing return type annotation for special method `__array__`
- tests/unit/bokeh/core/test_serialization.py:806:17: ANN204 Missing return type annotation for special method `__array__`

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
ANN204 4 2 2 0 0
ANN205 2 1 1 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Potential performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant