Skip to content

Commit

Permalink
Upgrade ruff to latest 0.0.282 version in pre-commits (#33152)
Browse files Browse the repository at this point in the history
  • Loading branch information
potiuk authored Aug 6, 2023
1 parent d24933c commit 6b892bf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ repos:
# Since ruff makes use of multiple cores we _purposefully_ don't run this in docker so it can use the
# host CPU to it's fullest
entry: ruff --fix --force-exclude
additional_dependencies: ['ruff==0.0.272']
additional_dependencies: ['ruff==0.0.282']
files: \.pyi?$
exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py
- repo: https://github.com/asottile/blacken-docs
Expand Down
4 changes: 1 addition & 3 deletions airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2219,9 +2219,7 @@ def clear(
return 0
if confirm_prompt:
ti_list = "\n".join(str(t) for t in tis)
question = (
"You are about to delete these {count} tasks:\n{ti_list}\n\nAre you sure? [y/n]"
).format(count=count, ti_list=ti_list)
question = f"You are about to delete these {count} tasks:\n{ti_list}\n\nAre you sure? [y/n]"
do_it = utils.helpers.ask_yesno(question)

if do_it:
Expand Down
6 changes: 1 addition & 5 deletions airflow/providers/qubole/hooks/qubole.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,7 @@ def execute(self, context: Context) -> None:
)

if self.cmd.status != "done": # type: ignore[attr-defined]
raise AirflowException(
"Command Id: {} failed with Status: {}".format(
self.cmd.id, self.cmd.status # type: ignore[attr-defined]
)
)
raise AirflowException(f"Command Id: {self.cmd.id} failed with Status: {self.cmd.status}")

def kill(self, ti):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ def push_packages_to_test_pypi(version):
"environment. The package download link is available at: "
"https://test.pypi.org/project/apache-airflow/#files "
"Install it with the appropriate constraint file, adapt python version: "
f"pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/apache-airflow=={version} --constraint https://raw.githubusercontent.com/apache/airflow/constraints-{version}/constraints-3.8.txt" # noqa: 501
f"pip install -i https://test.pypi.org/simple/ --extra-index-url "
f"https://pypi.org/simple/apache-airflow=={version} --constraint "
f"https://raw.githubusercontent.com/apache/airflow/"
f"constraints-{version}/constraints-3.8.txt"
)


Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/pre_commit/pre_commit_insert_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

os.environ["_SKIP_PYTHON_VERSION_CHECK"] = "true"

from common_precommit_utils import insert_documentation # isort: skip
from setup import EXTRAS_DEPENDENCIES # isort:skip
from common_precommit_utils import insert_documentation # isort: skip # noqa: E402
from setup import EXTRAS_DEPENDENCIES # isort:skip # noqa: E402

sys.path.append(str(AIRFLOW_SOURCES_DIR))

Expand Down
6 changes: 3 additions & 3 deletions scripts/ci/pre_commit/pre_commit_local_yml_mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@

sys.path.insert(0, str(Path(__file__).parent.resolve())) # make sure common_precommit_utils is imported

from common_precommit_utils import AIRFLOW_SOURCES_ROOT_PATH # isort: skip
from common_precommit_utils import AIRFLOW_SOURCES_ROOT_PATH # isort: skip # noqa: E402

sys.path.insert(0, str(AIRFLOW_SOURCES_ROOT_PATH)) # make sure setup is imported from Airflow
sys.path.insert(
0, str(AIRFLOW_SOURCES_ROOT_PATH / "dev" / "breeze" / "src")
) # make sure setup is imported from Airflow
# flake8: noqa: F401
from airflow_breeze.utils.docker_command_utils import VOLUMES_FOR_SELECTED_MOUNTS # isort: skip
from airflow_breeze.utils.docker_command_utils import VOLUMES_FOR_SELECTED_MOUNTS # isort: skip # noqa: E402

from common_precommit_utils import insert_documentation # isort: skip
from common_precommit_utils import insert_documentation # isort: skip # noqa: E402

sys.path.append(str(AIRFLOW_SOURCES_ROOT_PATH))

Expand Down

0 comments on commit 6b892bf

Please sign in to comment.