Compare commits
61 Commits
jack/seman
...
0.12.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef422460de | ||
|
|
dc2e8ab377 | ||
|
|
9aaa82d037 | ||
|
|
3288ac2dfb | ||
|
|
1167ed61cf | ||
|
|
2ee47d87b6 | ||
|
|
d324cedfc2 | ||
|
|
5a570c8e6d | ||
|
|
baadb5a78d | ||
|
|
df0648aae0 | ||
|
|
f0b03c3e86 | ||
|
|
9f6146a13d | ||
|
|
11d2cb6d56 | ||
|
|
d59282ebb5 | ||
|
|
e12747a903 | ||
|
|
5725c4b17f | ||
|
|
2f3c7ad1fc | ||
|
|
79c949f0f7 | ||
|
|
13bdba5d28 | ||
|
|
d76fd103ae | ||
|
|
ad28b80f96 | ||
|
|
3458f365da | ||
|
|
94cfdf4b40 | ||
|
|
498a04804d | ||
|
|
f34b65b7a0 | ||
|
|
6a05d46ef6 | ||
|
|
28820db1cd | ||
|
|
ea1aa9ebfe | ||
|
|
e72f10be2d | ||
|
|
d2fbf2af8f | ||
|
|
2abd683376 | ||
|
|
dc84645c36 | ||
|
|
f3f4db7104 | ||
|
|
5063a73d7f | ||
|
|
6bc52f2855 | ||
|
|
c433865801 | ||
|
|
5b6d0d17f1 | ||
|
|
5124cb393f | ||
|
|
11eb8d8f9f | ||
|
|
37617d1e37 | ||
|
|
14f6a3f133 | ||
|
|
ec65ca379d | ||
|
|
02c0db6781 | ||
|
|
18f2b27a55 | ||
|
|
618692cfd2 | ||
|
|
b8a9b1994b | ||
|
|
4d8ccb6125 | ||
|
|
8230b79829 | ||
|
|
5a116e48c3 | ||
|
|
3a542a80f6 | ||
|
|
4be6fc0979 | ||
|
|
7cc3f1ebe9 | ||
|
|
0ec4801b0d | ||
|
|
0095ff4c1a | ||
|
|
44755e6e86 | ||
|
|
8489816edc | ||
|
|
6b0eadfb4d | ||
|
|
8199154d54 | ||
|
|
50e1ecc086 | ||
|
|
fd35435281 | ||
|
|
fc72ff4a94 |
4
.github/workflows/build-binaries.yml
vendored
4
.github/workflows/build-binaries.yml
vendored
@@ -292,6 +292,8 @@ jobs:
|
||||
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
||||
- target: arm-unknown-linux-musleabihf
|
||||
arch: arm
|
||||
- target: riscv64gc-unknown-linux-gnu
|
||||
arch: riscv64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -319,7 +321,7 @@ jobs:
|
||||
githubToken: ${{ github.token }}
|
||||
install: |
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends python3 python3-pip
|
||||
apt-get install -y --no-install-recommends python3 python3-pip libatomic1
|
||||
pip3 install -U pip
|
||||
run: |
|
||||
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
|
||||
|
||||
8
.github/workflows/build-docker.yml
vendored
8
.github/workflows/build-docker.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
||||
|
||||
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||
|
||||
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -131,7 +131,7 @@ jobs:
|
||||
type=pep440,pattern={{ version }},value=${{ fromJson(inputs.plan).announcement_tag }}
|
||||
type=pep440,pattern={{ major }}.{{ minor }},value=${{ fromJson(inputs.plan).announcement_tag }}
|
||||
|
||||
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -169,7 +169,7 @@ jobs:
|
||||
steps:
|
||||
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||
|
||||
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
@@ -276,7 +276,7 @@ jobs:
|
||||
type=pep440,pattern={{ version }},value=${{ fromJson(inputs.plan).announcement_tag }}
|
||||
type=pep440,pattern={{ major }}.{{ minor }},value=${{ fromJson(inputs.plan).announcement_tag }}
|
||||
|
||||
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
||||
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
|
||||
34
.github/workflows/ci.yaml
vendored
34
.github/workflows/ci.yaml
vendored
@@ -38,7 +38,8 @@ jobs:
|
||||
fuzz: ${{ steps.check_fuzzer.outputs.changed }}
|
||||
# Flag that is set to "true" when code related to ty changes.
|
||||
ty: ${{ steps.check_ty.outputs.changed }}
|
||||
|
||||
# Flag that is set to "true" when code related to the py-fuzzer folder changes.
|
||||
py-fuzzer: ${{ steps.check_py_fuzzer.outputs.changed }}
|
||||
# Flag that is set to "true" when code related to the playground changes.
|
||||
playground: ${{ steps.check_playground.outputs.changed }}
|
||||
steps:
|
||||
@@ -68,7 +69,6 @@ jobs:
|
||||
':crates/ruff_text_size/**' \
|
||||
':crates/ruff_python_ast/**' \
|
||||
':crates/ruff_python_parser/**' \
|
||||
':python/py-fuzzer/**' \
|
||||
':.github/workflows/ci.yaml' \
|
||||
; then
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
@@ -138,6 +138,18 @@ jobs:
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Check if the py-fuzzer code changed
|
||||
id: check_py_fuzzer
|
||||
env:
|
||||
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
|
||||
run: |
|
||||
if git diff --quiet "${MERGE_BASE}...HEAD" -- 'python/py_fuzzer/**' \
|
||||
; then
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Check if there was any code related change
|
||||
id: check_code
|
||||
env:
|
||||
@@ -238,7 +250,7 @@ jobs:
|
||||
- name: "Install Rust toolchain"
|
||||
run: rustup show
|
||||
- name: "Install mold"
|
||||
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
|
||||
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
|
||||
- name: "Install cargo nextest"
|
||||
uses: taiki-e/install-action@6064345e6658255e90e9500fdf9a06ab77e6909c # v2.57.6
|
||||
with:
|
||||
@@ -296,7 +308,7 @@ jobs:
|
||||
- name: "Install Rust toolchain"
|
||||
run: rustup show
|
||||
- name: "Install mold"
|
||||
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
|
||||
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
|
||||
- name: "Install cargo nextest"
|
||||
uses: taiki-e/install-action@6064345e6658255e90e9500fdf9a06ab77e6909c # v2.57.6
|
||||
with:
|
||||
@@ -381,7 +393,7 @@ jobs:
|
||||
- name: "Install Rust toolchain"
|
||||
run: rustup show
|
||||
- name: "Install mold"
|
||||
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
|
||||
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
|
||||
- name: "Build"
|
||||
run: cargo build --release --locked
|
||||
|
||||
@@ -406,7 +418,7 @@ jobs:
|
||||
MSRV: ${{ steps.msrv.outputs.value }}
|
||||
run: rustup default "${MSRV}"
|
||||
- name: "Install mold"
|
||||
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
|
||||
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
|
||||
- name: "Build tests"
|
||||
shell: bash
|
||||
env:
|
||||
@@ -429,7 +441,7 @@ jobs:
|
||||
- name: "Install Rust toolchain"
|
||||
run: rustup show
|
||||
- name: "Install cargo-binstall"
|
||||
uses: cargo-bins/cargo-binstall@dd6a0ac24caa1243d18df0f770b941e990e8facc # v1.14.3
|
||||
uses: cargo-bins/cargo-binstall@79e4beb1e02f733a26129a6bf26c37dab4ab3307 # v1.14.4
|
||||
with:
|
||||
tool: cargo-fuzz@0.11.2
|
||||
- name: "Install cargo-fuzz"
|
||||
@@ -443,7 +455,7 @@ jobs:
|
||||
needs:
|
||||
- cargo-test-linux
|
||||
- determine_changes
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && needs.determine_changes.outputs.parser == 'true' }}
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.parser == 'true' || needs.determine_changes.outputs.py-fuzzer == 'true') }}
|
||||
timeout-minutes: 20
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
@@ -633,7 +645,7 @@ jobs:
|
||||
- cargo-test-linux
|
||||
- determine_changes
|
||||
# Only runs on pull requests, since that is the only we way we can find the base version for comparison.
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.ty == 'true' }}
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && (needs.determine_changes.outputs.ty == 'true' || needs.determine_changes.outputs.py-fuzzer == 'true') }}
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -682,7 +694,7 @@ jobs:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: cargo-bins/cargo-binstall@dd6a0ac24caa1243d18df0f770b941e990e8facc # v1.14.3
|
||||
- uses: cargo-bins/cargo-binstall@79e4beb1e02f733a26129a6bf26c37dab4ab3307 # v1.14.4
|
||||
- run: cargo binstall --no-confirm cargo-shear
|
||||
- run: cargo shear
|
||||
|
||||
@@ -728,7 +740,7 @@ jobs:
|
||||
with:
|
||||
node-version: 22
|
||||
- name: "Cache pre-commit"
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
||||
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
|
||||
2
.github/workflows/daily_fuzz.yaml
vendored
2
.github/workflows/daily_fuzz.yaml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
- name: "Install Rust toolchain"
|
||||
run: rustup show
|
||||
- name: "Install mold"
|
||||
uses: rui314/setup-mold@702b1908b5edf30d71a8d1666b724e0f0c6fa035 # v1
|
||||
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
|
||||
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
|
||||
- name: Build ruff
|
||||
# A debug build means the script runs slower once it gets started,
|
||||
|
||||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -129,14 +129,14 @@ jobs:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
- name: Install cached dist
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: cargo-dist-cache
|
||||
path: ~/.cargo/bin/
|
||||
- run: chmod +x ~/.cargo/bin/dist
|
||||
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
|
||||
- name: Fetch local artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
pattern: artifacts-*
|
||||
path: target/distrib/
|
||||
@@ -180,14 +180,14 @@ jobs:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
- name: Install cached dist
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
name: cargo-dist-cache
|
||||
path: ~/.cargo/bin/
|
||||
- run: chmod +x ~/.cargo/bin/dist
|
||||
# Fetch artifacts from scratch-storage
|
||||
- name: Fetch artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
pattern: artifacts-*
|
||||
path: target/distrib/
|
||||
@@ -257,7 +257,7 @@ jobs:
|
||||
submodules: recursive
|
||||
# Create a GitHub Release while uploading all files to it
|
||||
- name: "Download GitHub Artifacts"
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
|
||||
with:
|
||||
pattern: artifacts-*
|
||||
path: artifacts
|
||||
|
||||
26
CHANGELOG.md
26
CHANGELOG.md
@@ -1,5 +1,31 @@
|
||||
# Changelog
|
||||
|
||||
## 0.12.9
|
||||
|
||||
### Preview features
|
||||
|
||||
- \[`airflow`\] Add check for `airflow.secrets.cache.SecretCache` (`AIR301`) ([#17707](https://github.com/astral-sh/ruff/pull/17707))
|
||||
- \[`ruff`\] Offer a safe fix for multi-digit zeros (`RUF064`) ([#19847](https://github.com/astral-sh/ruff/pull/19847))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- \[`flake8-blind-except`\] Fix `BLE001` false-positive on `raise ... from None` ([#19755](https://github.com/astral-sh/ruff/pull/19755))
|
||||
- \[`flake8-comprehensions`\] Fix false positive for `C420` with attribute, subscript, or slice assignment targets ([#19513](https://github.com/astral-sh/ruff/pull/19513))
|
||||
- \[`flake8-simplify`\] Fix handling of U+001C..U+001F whitespace (`SIM905`) ([#19849](https://github.com/astral-sh/ruff/pull/19849))
|
||||
|
||||
### Rule changes
|
||||
|
||||
- \[`pylint`\] Use lowercase hex characters to match the formatter (`PLE2513`) ([#19808](https://github.com/astral-sh/ruff/pull/19808))
|
||||
|
||||
### Documentation
|
||||
|
||||
- Fix `lint.future-annotations` link ([#19876](https://github.com/astral-sh/ruff/pull/19876))
|
||||
|
||||
### Other changes
|
||||
|
||||
- Build `riscv64` binaries for release ([#19819](https://github.com/astral-sh/ruff/pull/19819))
|
||||
- Add rule code to error description in GitLab output ([#19896](https://github.com/astral-sh/ruff/pull/19896))
|
||||
|
||||
## 0.12.8
|
||||
|
||||
### Preview features
|
||||
|
||||
40
Cargo.lock
generated
40
Cargo.lock
generated
@@ -322,9 +322,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "camino"
|
||||
version = "1.1.10"
|
||||
version = "1.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab"
|
||||
checksum = "5d07aa9a93b00c76f71bc35d598bed923f6d4f3a9ca5c24b7737ae1a292841c0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@@ -1178,7 +1178,7 @@ checksum = "5697765925a05c9d401dd04a93dfd662d336cc25fdcc3301220385a1ffcfdde5"
|
||||
dependencies = [
|
||||
"compact_str",
|
||||
"get-size-derive2",
|
||||
"hashbrown 0.15.4",
|
||||
"hashbrown 0.15.5",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
@@ -1264,9 +1264,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.15.4"
|
||||
version = "0.15.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
|
||||
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||
dependencies = [
|
||||
"allocator-api2",
|
||||
"equivalent",
|
||||
@@ -1279,7 +1279,7 @@ version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
|
||||
dependencies = [
|
||||
"hashbrown 0.15.4",
|
||||
"hashbrown 0.15.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1471,7 +1471,7 @@ version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17d34b7d42178945f775e84bc4c36dde7c1c6cdfea656d3354d009056f2bb3d2"
|
||||
dependencies = [
|
||||
"hashbrown 0.15.4",
|
||||
"hashbrown 0.15.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1491,7 +1491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.15.4",
|
||||
"hashbrown 0.15.5",
|
||||
"serde",
|
||||
]
|
||||
|
||||
@@ -2473,9 +2473,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.95"
|
||||
version = "1.0.96"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
|
||||
checksum = "beef09f85ae72cea1ef96ba6870c51e6382ebfa4f0e85b643459331f3daa5be0"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
@@ -2743,7 +2743,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.12.8"
|
||||
version = "0.12.9"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"argfile",
|
||||
@@ -2996,7 +2996,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ruff_linter"
|
||||
version = "0.12.8"
|
||||
version = "0.12.9"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"anyhow",
|
||||
@@ -3006,7 +3006,7 @@ dependencies = [
|
||||
"fern",
|
||||
"glob",
|
||||
"globset",
|
||||
"hashbrown 0.15.4",
|
||||
"hashbrown 0.15.5",
|
||||
"imperative",
|
||||
"insta",
|
||||
"is-macro",
|
||||
@@ -3022,7 +3022,6 @@ dependencies = [
|
||||
"pep440_rs",
|
||||
"pyproject-toml",
|
||||
"regex",
|
||||
"ruff_annotate_snippets",
|
||||
"ruff_cache",
|
||||
"ruff_db",
|
||||
"ruff_diagnostics",
|
||||
@@ -3074,6 +3073,7 @@ name = "ruff_memory_usage"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"get-size2",
|
||||
"ordermap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3335,7 +3335,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ruff_wasm"
|
||||
version = "0.12.8"
|
||||
version = "0.12.9"
|
||||
dependencies = [
|
||||
"console_error_panic_hook",
|
||||
"console_log",
|
||||
@@ -3450,13 +3450,13 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||
[[package]]
|
||||
name = "salsa"
|
||||
version = "0.23.0"
|
||||
source = "git+https://github.com/salsa-rs/salsa.git?rev=b121ee46c4483ba74c19e933a3522bd548eb7343#b121ee46c4483ba74c19e933a3522bd548eb7343"
|
||||
source = "git+https://github.com/salsa-rs/salsa.git?rev=918d35d873b2b73a0237536144ef4d22e8d57f27#918d35d873b2b73a0237536144ef4d22e8d57f27"
|
||||
dependencies = [
|
||||
"boxcar",
|
||||
"compact_str",
|
||||
"crossbeam-queue",
|
||||
"crossbeam-utils",
|
||||
"hashbrown 0.15.4",
|
||||
"hashbrown 0.15.5",
|
||||
"hashlink",
|
||||
"indexmap",
|
||||
"intrusive-collections",
|
||||
@@ -3474,12 +3474,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "salsa-macro-rules"
|
||||
version = "0.23.0"
|
||||
source = "git+https://github.com/salsa-rs/salsa.git?rev=b121ee46c4483ba74c19e933a3522bd548eb7343#b121ee46c4483ba74c19e933a3522bd548eb7343"
|
||||
source = "git+https://github.com/salsa-rs/salsa.git?rev=918d35d873b2b73a0237536144ef4d22e8d57f27#918d35d873b2b73a0237536144ef4d22e8d57f27"
|
||||
|
||||
[[package]]
|
||||
name = "salsa-macros"
|
||||
version = "0.23.0"
|
||||
source = "git+https://github.com/salsa-rs/salsa.git?rev=b121ee46c4483ba74c19e933a3522bd548eb7343#b121ee46c4483ba74c19e933a3522bd548eb7343"
|
||||
source = "git+https://github.com/salsa-rs/salsa.git?rev=918d35d873b2b73a0237536144ef4d22e8d57f27#918d35d873b2b73a0237536144ef4d22e8d57f27"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -4306,7 +4306,7 @@ dependencies = [
|
||||
"drop_bomb",
|
||||
"get-size2",
|
||||
"glob",
|
||||
"hashbrown 0.15.4",
|
||||
"hashbrown 0.15.5",
|
||||
"indexmap",
|
||||
"insta",
|
||||
"itertools 0.14.0",
|
||||
|
||||
@@ -143,7 +143,7 @@ regex-automata = { version = "0.4.9" }
|
||||
rustc-hash = { version = "2.0.0" }
|
||||
rustc-stable-hash = { version = "0.1.2" }
|
||||
# When updating salsa, make sure to also update the revision in `fuzz/Cargo.toml`
|
||||
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "b121ee46c4483ba74c19e933a3522bd548eb7343", default-features = false, features = [
|
||||
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "918d35d873b2b73a0237536144ef4d22e8d57f27", default-features = false, features = [
|
||||
"compact_str",
|
||||
"macros",
|
||||
"salsa_unstable",
|
||||
|
||||
@@ -148,8 +148,8 @@ curl -LsSf https://astral.sh/ruff/install.sh | sh
|
||||
powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
|
||||
|
||||
# For a specific version.
|
||||
curl -LsSf https://astral.sh/ruff/0.12.8/install.sh | sh
|
||||
powershell -c "irm https://astral.sh/ruff/0.12.8/install.ps1 | iex"
|
||||
curl -LsSf https://astral.sh/ruff/0.12.9/install.sh | sh
|
||||
powershell -c "irm https://astral.sh/ruff/0.12.9/install.ps1 | iex"
|
||||
```
|
||||
|
||||
You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff),
|
||||
@@ -182,7 +182,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff
|
||||
```yaml
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: v0.12.8
|
||||
rev: v0.12.9
|
||||
hooks:
|
||||
# Run the linter.
|
||||
- id: ruff-check
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ruff"
|
||||
version = "0.12.8"
|
||||
version = "0.12.9"
|
||||
publish = true
|
||||
authors = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
@@ -85,7 +85,7 @@ dist = true
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
mimalloc = { workspace = true }
|
||||
|
||||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), not(target_os = "aix"), not(target_os = "android"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64")))'.dependencies]
|
||||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), not(target_os = "aix"), not(target_os = "android"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64", target_arch = "riscv64")))'.dependencies]
|
||||
tikv-jemallocator = { workspace = true }
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -13,25 +13,16 @@ use itertools::Itertools;
|
||||
use log::{debug, error};
|
||||
use rayon::iter::ParallelIterator;
|
||||
use rayon::iter::{IntoParallelIterator, ParallelBridge};
|
||||
use ruff_linter::codes::Rule;
|
||||
use rustc_hash::FxHashMap;
|
||||
use tempfile::NamedTempFile;
|
||||
|
||||
use ruff_cache::{CacheKey, CacheKeyHasher};
|
||||
use ruff_db::diagnostic::Diagnostic;
|
||||
use ruff_diagnostics::Fix;
|
||||
use ruff_linter::message::create_lint_diagnostic;
|
||||
use ruff_linter::package::PackageRoot;
|
||||
use ruff_linter::{VERSION, warn_user};
|
||||
use ruff_macros::CacheKey;
|
||||
use ruff_notebook::NotebookIndex;
|
||||
use ruff_source_file::SourceFileBuilder;
|
||||
use ruff_text_size::{TextRange, TextSize};
|
||||
use ruff_workspace::Settings;
|
||||
use ruff_workspace::resolver::Resolver;
|
||||
|
||||
use crate::diagnostics::Diagnostics;
|
||||
|
||||
/// [`Path`] that is relative to the package root in [`PackageCache`].
|
||||
pub(crate) type RelativePath = Path;
|
||||
/// [`PathBuf`] that is relative to the package root in [`PackageCache`].
|
||||
@@ -298,13 +289,8 @@ impl Cache {
|
||||
});
|
||||
}
|
||||
|
||||
pub(crate) fn update_lint(
|
||||
&self,
|
||||
path: RelativePathBuf,
|
||||
key: &FileCacheKey,
|
||||
data: LintCacheData,
|
||||
) {
|
||||
self.update(path, key, ChangeData::Lint(data));
|
||||
pub(crate) fn set_linted(&self, path: RelativePathBuf, key: &FileCacheKey, yes: bool) {
|
||||
self.update(path, key, ChangeData::Linted(yes));
|
||||
}
|
||||
|
||||
pub(crate) fn set_formatted(&self, path: RelativePathBuf, key: &FileCacheKey) {
|
||||
@@ -339,42 +325,15 @@ pub(crate) struct FileCache {
|
||||
}
|
||||
|
||||
impl FileCache {
|
||||
/// Convert the file cache into `Diagnostics`, using `path` as file name.
|
||||
pub(crate) fn to_diagnostics(&self, path: &Path) -> Option<Diagnostics> {
|
||||
self.data.lint.as_ref().map(|lint| {
|
||||
let diagnostics = if lint.messages.is_empty() {
|
||||
Vec::new()
|
||||
} else {
|
||||
let file = SourceFileBuilder::new(path.to_string_lossy(), &*lint.source).finish();
|
||||
lint.messages
|
||||
.iter()
|
||||
.map(|msg| {
|
||||
create_lint_diagnostic(
|
||||
&msg.body,
|
||||
msg.suggestion.as_ref(),
|
||||
msg.range,
|
||||
msg.fix.clone(),
|
||||
msg.parent,
|
||||
file.clone(),
|
||||
msg.noqa_offset,
|
||||
msg.rule,
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
};
|
||||
let notebook_indexes = if let Some(notebook_index) = lint.notebook_index.as_ref() {
|
||||
FxHashMap::from_iter([(path.to_string_lossy().to_string(), notebook_index.clone())])
|
||||
} else {
|
||||
FxHashMap::default()
|
||||
};
|
||||
Diagnostics::new(diagnostics, notebook_indexes)
|
||||
})
|
||||
/// Return whether or not the file in the cache was linted and found to have no diagnostics.
|
||||
pub(crate) fn linted(&self) -> bool {
|
||||
self.data.linted
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, bincode::Decode, bincode::Encode)]
|
||||
struct FileCacheData {
|
||||
lint: Option<LintCacheData>,
|
||||
linted: bool,
|
||||
formatted: bool,
|
||||
}
|
||||
|
||||
@@ -410,88 +369,6 @@ pub(crate) fn init(path: &Path) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(bincode::Decode, Debug, bincode::Encode, PartialEq)]
|
||||
pub(crate) struct LintCacheData {
|
||||
/// Imports made.
|
||||
// pub(super) imports: ImportMap,
|
||||
/// Diagnostic messages.
|
||||
pub(super) messages: Vec<CacheMessage>,
|
||||
/// Source code of the file.
|
||||
///
|
||||
/// # Notes
|
||||
///
|
||||
/// This will be empty if `messages` is empty.
|
||||
pub(super) source: String,
|
||||
/// Notebook index if this file is a Jupyter Notebook.
|
||||
#[bincode(with_serde)]
|
||||
pub(super) notebook_index: Option<NotebookIndex>,
|
||||
}
|
||||
|
||||
impl LintCacheData {
|
||||
pub(crate) fn from_diagnostics(
|
||||
diagnostics: &[Diagnostic],
|
||||
notebook_index: Option<NotebookIndex>,
|
||||
) -> Self {
|
||||
let source = if let Some(msg) = diagnostics.first() {
|
||||
msg.expect_ruff_source_file().source_text().to_owned()
|
||||
} else {
|
||||
String::new() // No messages, no need to keep the source!
|
||||
};
|
||||
|
||||
let messages = diagnostics
|
||||
.iter()
|
||||
// Parse the kebab-case rule name into a `Rule`. This will fail for syntax errors, so
|
||||
// this also serves to filter them out, but we shouldn't be caching files with syntax
|
||||
// errors anyway.
|
||||
.filter_map(|msg| Some((msg.name().parse().ok()?, msg)))
|
||||
.map(|(rule, msg)| {
|
||||
// Make sure that all message use the same source file.
|
||||
assert_eq!(
|
||||
msg.expect_ruff_source_file(),
|
||||
diagnostics.first().unwrap().expect_ruff_source_file(),
|
||||
"message uses a different source file"
|
||||
);
|
||||
CacheMessage {
|
||||
rule,
|
||||
body: msg.body().to_string(),
|
||||
suggestion: msg.first_help_text().map(ToString::to_string),
|
||||
range: msg.expect_range(),
|
||||
parent: msg.parent(),
|
||||
fix: msg.fix().cloned(),
|
||||
noqa_offset: msg.noqa_offset(),
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
Self {
|
||||
messages,
|
||||
source,
|
||||
notebook_index,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// On disk representation of a diagnostic message.
|
||||
#[derive(bincode::Decode, Debug, bincode::Encode, PartialEq)]
|
||||
pub(super) struct CacheMessage {
|
||||
/// The rule for the cached diagnostic.
|
||||
#[bincode(with_serde)]
|
||||
rule: Rule,
|
||||
/// The message body to display to the user, to explain the diagnostic.
|
||||
body: String,
|
||||
/// The message to display to the user, to explain the suggested fix.
|
||||
suggestion: Option<String>,
|
||||
/// Range into the message's [`FileCache::source`].
|
||||
#[bincode(with_serde)]
|
||||
range: TextRange,
|
||||
#[bincode(with_serde)]
|
||||
parent: Option<TextSize>,
|
||||
#[bincode(with_serde)]
|
||||
fix: Option<Fix>,
|
||||
#[bincode(with_serde)]
|
||||
noqa_offset: Option<TextSize>,
|
||||
}
|
||||
|
||||
pub(crate) trait PackageCaches {
|
||||
fn get(&self, package_root: &Path) -> Option<&Cache>;
|
||||
|
||||
@@ -579,15 +456,15 @@ struct Change {
|
||||
|
||||
#[derive(Debug)]
|
||||
enum ChangeData {
|
||||
Lint(LintCacheData),
|
||||
Linted(bool),
|
||||
Formatted,
|
||||
}
|
||||
|
||||
impl ChangeData {
|
||||
fn apply(self, data: &mut FileCacheData) {
|
||||
match self {
|
||||
ChangeData::Lint(new_lint) => {
|
||||
data.lint = Some(new_lint);
|
||||
ChangeData::Linted(yes) => {
|
||||
data.linted = yes;
|
||||
}
|
||||
ChangeData::Formatted => {
|
||||
data.formatted = true;
|
||||
@@ -612,7 +489,6 @@ mod tests {
|
||||
use test_case::test_case;
|
||||
|
||||
use ruff_cache::CACHE_DIR_NAME;
|
||||
use ruff_db::diagnostic::Diagnostic;
|
||||
use ruff_linter::package::PackageRoot;
|
||||
use ruff_linter::settings::LinterSettings;
|
||||
use ruff_linter::settings::flags;
|
||||
@@ -620,7 +496,7 @@ mod tests {
|
||||
use ruff_python_ast::{PySourceType, PythonVersion};
|
||||
use ruff_workspace::Settings;
|
||||
|
||||
use crate::cache::{self, FileCache, FileCacheData, FileCacheKey};
|
||||
use crate::cache::{self, ChangeData, FileCache, FileCacheData, FileCacheKey};
|
||||
use crate::cache::{Cache, RelativePathBuf};
|
||||
use crate::commands::format::{FormatCommandError, FormatMode, FormatResult, format_path};
|
||||
use crate::diagnostics::{Diagnostics, lint_path};
|
||||
@@ -647,7 +523,7 @@ mod tests {
|
||||
assert_eq!(cache.changes.lock().unwrap().len(), 0);
|
||||
|
||||
let mut paths = Vec::new();
|
||||
let mut parse_errors = Vec::new();
|
||||
let mut paths_with_diagnostics = Vec::new();
|
||||
let mut expected_diagnostics = Diagnostics::default();
|
||||
for entry in fs::read_dir(&package_root).unwrap() {
|
||||
let entry = entry.unwrap();
|
||||
@@ -671,7 +547,7 @@ mod tests {
|
||||
continue;
|
||||
}
|
||||
|
||||
let diagnostics = lint_path(
|
||||
let mut diagnostics = lint_path(
|
||||
&path,
|
||||
Some(PackageRoot::root(&package_root)),
|
||||
&settings.linter,
|
||||
@@ -681,8 +557,15 @@ mod tests {
|
||||
UnsafeFixes::Enabled,
|
||||
)
|
||||
.unwrap();
|
||||
if diagnostics.inner.iter().any(Diagnostic::is_invalid_syntax) {
|
||||
parse_errors.push(path.clone());
|
||||
if diagnostics.inner.is_empty() {
|
||||
// We won't load a notebook index from the cache for files without diagnostics,
|
||||
// so remove them from `expected_diagnostics` too. This allows us to keep the
|
||||
// full equality assertion below.
|
||||
diagnostics
|
||||
.notebook_indexes
|
||||
.remove(&path.to_string_lossy().to_string());
|
||||
} else {
|
||||
paths_with_diagnostics.push(path.clone());
|
||||
}
|
||||
paths.push(path);
|
||||
expected_diagnostics += diagnostics;
|
||||
@@ -695,11 +578,11 @@ mod tests {
|
||||
let cache = Cache::open(package_root.clone(), &settings);
|
||||
assert_ne!(cache.package.files.len(), 0);
|
||||
|
||||
parse_errors.sort();
|
||||
paths_with_diagnostics.sort();
|
||||
|
||||
for path in &paths {
|
||||
if parse_errors.binary_search(path).is_ok() {
|
||||
continue; // We don't cache parsing errors.
|
||||
if paths_with_diagnostics.binary_search(path).is_ok() {
|
||||
continue; // We don't cache files with diagnostics.
|
||||
}
|
||||
|
||||
let relative_path = cache.relative_path(path).unwrap();
|
||||
@@ -733,7 +616,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn cache_adds_file_on_lint() {
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\"])\n";
|
||||
|
||||
let test_cache = TestCache::new("cache_adds_file_on_lint");
|
||||
let cache = test_cache.open();
|
||||
@@ -757,7 +640,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn cache_adds_files_on_lint() {
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\"])\n";
|
||||
|
||||
let test_cache = TestCache::new("cache_adds_files_on_lint");
|
||||
let cache = test_cache.open();
|
||||
@@ -782,6 +665,40 @@ mod tests {
|
||||
cache.persist().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cache_does_not_add_file_on_lint_with_diagnostic() {
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
|
||||
let test_cache = TestCache::new("cache_does_not_add_file_on_lint_with_diagnostic");
|
||||
let cache = test_cache.open();
|
||||
test_cache.write_source_file("source.py", source);
|
||||
assert_eq!(cache.changes.lock().unwrap().len(), 0);
|
||||
|
||||
cache.persist().unwrap();
|
||||
let cache = test_cache.open();
|
||||
|
||||
let results = test_cache
|
||||
.lint_file_with_cache("source.py", &cache)
|
||||
.expect("Failed to lint test file");
|
||||
assert_eq!(results.inner.len(), 1, "Expected one F822 diagnostic");
|
||||
assert_eq!(
|
||||
cache.changes.lock().unwrap().len(),
|
||||
1,
|
||||
"Files with diagnostics still trigger change events"
|
||||
);
|
||||
assert!(
|
||||
cache
|
||||
.changes
|
||||
.lock()
|
||||
.unwrap()
|
||||
.last()
|
||||
.is_some_and(|change| matches!(change.new_data, ChangeData::Linted(false))),
|
||||
"Files with diagnostics are marked as unlinted"
|
||||
);
|
||||
|
||||
cache.persist().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cache_adds_files_on_format() {
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
@@ -812,7 +729,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn cache_invalidated_on_file_modified_time() {
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\"])\n";
|
||||
|
||||
let test_cache = TestCache::new("cache_invalidated_on_file_modified_time");
|
||||
let cache = test_cache.open();
|
||||
@@ -869,7 +786,7 @@ mod tests {
|
||||
file.set_permissions(perms)
|
||||
}
|
||||
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\"])\n";
|
||||
|
||||
let test_cache = TestCache::new("cache_invalidated_on_permission_change");
|
||||
let cache = test_cache.open();
|
||||
@@ -922,7 +839,7 @@ mod tests {
|
||||
);
|
||||
|
||||
// Now actually lint a file.
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\"])\n";
|
||||
test_cache.write_source_file("new.py", source);
|
||||
let new_path_key = RelativePathBuf::from("new.py");
|
||||
assert_eq!(cache.changes.lock().unwrap().len(), 0);
|
||||
@@ -945,7 +862,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn format_updates_cache_entry() {
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\", \"b\"])\n";
|
||||
let source: &[u8] = b"a = 1\n\n__all__ = list([\"a\"])\n";
|
||||
|
||||
let test_cache = TestCache::new("format_updates_cache_entry");
|
||||
let cache = test_cache.open();
|
||||
@@ -979,7 +896,7 @@ mod tests {
|
||||
panic!("Cache entry for `source.py` is missing.");
|
||||
};
|
||||
|
||||
assert!(file_cache.data.lint.is_some());
|
||||
assert!(file_cache.data.linted);
|
||||
assert!(file_cache.data.formatted);
|
||||
}
|
||||
|
||||
@@ -1029,7 +946,7 @@ mod tests {
|
||||
panic!("Cache entry for `source.py` is missing.");
|
||||
};
|
||||
|
||||
assert_eq!(file_cache.data.lint, None);
|
||||
assert!(!file_cache.data.linted);
|
||||
assert!(file_cache.data.formatted);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,15 +20,21 @@ use ruff_linter::settings::types::UnsafeFixes;
|
||||
use ruff_linter::settings::{LinterSettings, flags};
|
||||
use ruff_linter::source_kind::{SourceError, SourceKind};
|
||||
use ruff_linter::{IOError, Violation, fs};
|
||||
use ruff_notebook::{Notebook, NotebookError, NotebookIndex};
|
||||
use ruff_notebook::{NotebookError, NotebookIndex};
|
||||
use ruff_python_ast::{PySourceType, SourceType, TomlSourceType};
|
||||
use ruff_source_file::SourceFileBuilder;
|
||||
use ruff_text_size::TextRange;
|
||||
use ruff_workspace::Settings;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use crate::cache::{Cache, FileCacheKey, LintCacheData};
|
||||
use crate::cache::{Cache, FileCache, FileCacheKey};
|
||||
|
||||
/// A collection of [`Diagnostic`]s and additional information needed to render them.
|
||||
///
|
||||
/// Note that `notebook_indexes` may be empty if there are no diagnostics because the
|
||||
/// `NotebookIndex` isn't cached in this case. This isn't a problem for any current uses as of
|
||||
/// 2025-08-12, which are all related to diagnostic rendering, but could be surprising if used
|
||||
/// differently in the future.
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub(crate) struct Diagnostics {
|
||||
pub(crate) inner: Vec<Diagnostic>,
|
||||
@@ -193,19 +199,9 @@ pub(crate) fn lint_path(
|
||||
let cache_key = FileCacheKey::from_path(path).context("Failed to create cache key")?;
|
||||
let cached_diagnostics = cache
|
||||
.get(relative_path, &cache_key)
|
||||
.and_then(|entry| entry.to_diagnostics(path));
|
||||
if let Some(diagnostics) = cached_diagnostics {
|
||||
// `FixMode::Generate` and `FixMode::Diff` rely on side-effects (writing to disk,
|
||||
// and writing the diff to stdout, respectively). If a file has diagnostics, we
|
||||
// need to avoid reading from and writing to the cache in these modes.
|
||||
if match fix_mode {
|
||||
flags::FixMode::Generate => true,
|
||||
flags::FixMode::Apply | flags::FixMode::Diff => {
|
||||
diagnostics.inner.is_empty() && diagnostics.fixed.is_empty()
|
||||
}
|
||||
} {
|
||||
return Ok(diagnostics);
|
||||
}
|
||||
.is_some_and(FileCache::linted);
|
||||
if cached_diagnostics {
|
||||
return Ok(Diagnostics::default());
|
||||
}
|
||||
|
||||
// Stash the file metadata for later so when we update the cache it reflects the prerun
|
||||
@@ -322,31 +318,21 @@ pub(crate) fn lint_path(
|
||||
(result, transformed, fixed)
|
||||
};
|
||||
|
||||
let has_error = result.has_syntax_errors();
|
||||
let diagnostics = result.diagnostics;
|
||||
|
||||
if let Some((cache, relative_path, key)) = caching {
|
||||
// We don't cache parsing errors.
|
||||
if !has_error {
|
||||
// `FixMode::Apply` and `FixMode::Diff` rely on side-effects (writing to disk,
|
||||
// and writing the diff to stdout, respectively). If a file has diagnostics, we
|
||||
// need to avoid reading from and writing to the cache in these modes.
|
||||
if match fix_mode {
|
||||
flags::FixMode::Generate => true,
|
||||
flags::FixMode::Apply | flags::FixMode::Diff => {
|
||||
diagnostics.is_empty() && fixed.is_empty()
|
||||
}
|
||||
} {
|
||||
cache.update_lint(
|
||||
relative_path.to_owned(),
|
||||
&key,
|
||||
LintCacheData::from_diagnostics(
|
||||
&diagnostics,
|
||||
transformed.as_ipy_notebook().map(Notebook::index).cloned(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// `FixMode::Apply` and `FixMode::Diff` rely on side-effects (writing to disk,
|
||||
// and writing the diff to stdout, respectively). If a file has diagnostics
|
||||
// with fixes, we need to avoid reading from and writing to the cache in these
|
||||
// modes.
|
||||
let use_fixes = match fix_mode {
|
||||
flags::FixMode::Generate => true,
|
||||
flags::FixMode::Apply | flags::FixMode::Diff => fixed.is_empty(),
|
||||
};
|
||||
|
||||
// We don't cache files with diagnostics.
|
||||
let linted = diagnostics.is_empty() && use_fixes;
|
||||
cache.set_linted(relative_path.to_owned(), &key, linted);
|
||||
}
|
||||
|
||||
let notebook_indexes = if let SourceKind::IpyNotebook(notebook) = transformed {
|
||||
|
||||
@@ -19,7 +19,8 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
any(
|
||||
target_arch = "x86_64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "powerpc64"
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv64"
|
||||
)
|
||||
))]
|
||||
#[global_allocator]
|
||||
|
||||
@@ -115,12 +115,13 @@ fn stdin_error() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> -:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
Found 1 error.
|
||||
[*] 1 fixable with the `--fix` option.
|
||||
@@ -139,12 +140,13 @@ fn stdin_filename() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
F401.py:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> F401.py:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
Found 1 error.
|
||||
[*] 1 fixable with the `--fix` option.
|
||||
@@ -174,19 +176,21 @@ import bar # unused import
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
bar.py:2:8: F401 [*] `bar` imported but unused
|
||||
F401 [*] `bar` imported but unused
|
||||
--> bar.py:2:8
|
||||
|
|
||||
2 | import bar # unused import
|
||||
| ^^^ F401
|
||||
| ^^^
|
||||
|
|
||||
= help: Remove unused import: `bar`
|
||||
help: Remove unused import: `bar`
|
||||
|
||||
foo.py:2:8: F401 [*] `foo` imported but unused
|
||||
F401 [*] `foo` imported but unused
|
||||
--> foo.py:2:8
|
||||
|
|
||||
2 | import foo # unused import
|
||||
| ^^^ F401
|
||||
| ^^^
|
||||
|
|
||||
= help: Remove unused import: `foo`
|
||||
help: Remove unused import: `foo`
|
||||
|
||||
Found 2 errors.
|
||||
[*] 2 fixable with the `--fix` option.
|
||||
@@ -208,12 +212,13 @@ fn check_warn_stdin_filename_with_files() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
F401.py:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> F401.py:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
Found 1 error.
|
||||
[*] 1 fixable with the `--fix` option.
|
||||
@@ -234,12 +239,13 @@ fn stdin_source_type_py() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
TCH.py:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> TCH.py:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
Found 1 error.
|
||||
[*] 1 fixable with the `--fix` option.
|
||||
@@ -471,10 +477,11 @@ fn stdin_fix_jupyter() {
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
----- stderr -----
|
||||
Jupyter.ipynb:cell 3:1:7: F821 Undefined name `x`
|
||||
F821 Undefined name `x`
|
||||
--> Jupyter.ipynb:cell 3:1:7
|
||||
|
|
||||
1 | print(x)
|
||||
| ^ F821
|
||||
| ^
|
||||
|
|
||||
|
||||
Found 3 errors (2 fixed, 1 remaining).
|
||||
@@ -569,19 +576,21 @@ fn stdin_override_parser_ipynb() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
Jupyter.py:cell 1:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> Jupyter.py:cell 1:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
Jupyter.py:cell 3:1:8: F401 [*] `sys` imported but unused
|
||||
F401 [*] `sys` imported but unused
|
||||
--> Jupyter.py:cell 3:1:8
|
||||
|
|
||||
1 | import sys
|
||||
| ^^^ F401
|
||||
| ^^^
|
||||
|
|
||||
= help: Remove unused import: `sys`
|
||||
help: Remove unused import: `sys`
|
||||
|
||||
Found 2 errors.
|
||||
[*] 2 fixable with the `--fix` option.
|
||||
@@ -605,12 +614,13 @@ fn stdin_override_parser_py() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
F401.ipynb:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> F401.ipynb:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
Found 1 error.
|
||||
[*] 1 fixable with the `--fix` option.
|
||||
@@ -633,12 +643,13 @@ fn stdin_fix_when_not_fixable_should_still_print_contents() {
|
||||
print(sys.version)
|
||||
|
||||
----- stderr -----
|
||||
-:3:4: F634 If test is a tuple, which is always `True`
|
||||
F634 If test is a tuple, which is always `True`
|
||||
--> -:3:4
|
||||
|
|
||||
1 | import sys
|
||||
2 |
|
||||
3 | if (1, 2):
|
||||
| ^^^^^^ F634
|
||||
| ^^^^^^
|
||||
4 | print(sys.version)
|
||||
|
|
||||
|
||||
@@ -798,7 +809,8 @@ fn stdin_parse_error() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:16: invalid-syntax: Expected one or more symbol names after import
|
||||
invalid-syntax: Expected one or more symbol names after import
|
||||
--> -:1:16
|
||||
|
|
||||
1 | from foo import
|
||||
| ^
|
||||
@@ -818,14 +830,16 @@ fn stdin_multiple_parse_error() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:16: invalid-syntax: Expected one or more symbol names after import
|
||||
invalid-syntax: Expected one or more symbol names after import
|
||||
--> -:1:16
|
||||
|
|
||||
1 | from foo import
|
||||
| ^
|
||||
2 | bar =
|
||||
|
|
||||
|
||||
-:2:6: invalid-syntax: Expected an expression
|
||||
invalid-syntax: Expected an expression
|
||||
--> -:2:6
|
||||
|
|
||||
1 | from foo import
|
||||
2 | bar =
|
||||
@@ -847,7 +861,8 @@ fn parse_error_not_included() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:6: invalid-syntax: Expected an expression
|
||||
invalid-syntax: Expected an expression
|
||||
--> -:1:6
|
||||
|
|
||||
1 | foo =
|
||||
| ^
|
||||
@@ -867,10 +882,11 @@ fn full_output_preview() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: E741 Ambiguous variable name: `l`
|
||||
E741 Ambiguous variable name: `l`
|
||||
--> -:1:1
|
||||
|
|
||||
1 | l = 1
|
||||
| ^ E741
|
||||
| ^
|
||||
|
|
||||
|
||||
Found 1 error.
|
||||
@@ -895,10 +911,11 @@ preview = true
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: E741 Ambiguous variable name: `l`
|
||||
E741 Ambiguous variable name: `l`
|
||||
--> -:1:1
|
||||
|
|
||||
1 | l = 1
|
||||
| ^ E741
|
||||
| ^
|
||||
|
|
||||
|
||||
Found 1 error.
|
||||
@@ -916,10 +933,11 @@ fn full_output_format() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: E741 Ambiguous variable name: `l`
|
||||
E741 Ambiguous variable name: `l`
|
||||
--> -:1:1
|
||||
|
|
||||
1 | l = 1
|
||||
| ^ E741
|
||||
| ^
|
||||
|
|
||||
|
||||
Found 1 error.
|
||||
@@ -1406,7 +1424,9 @@ fn redirect_direct() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF950 Hey this is a test rule that was redirected from another.
|
||||
RUF950 Hey this is a test rule that was redirected from another.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
|
||||
----- stderr -----
|
||||
@@ -1438,7 +1458,9 @@ fn redirect_prefix() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF950 Hey this is a test rule that was redirected from another.
|
||||
RUF950 Hey this is a test rule that was redirected from another.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
|
||||
----- stderr -----
|
||||
@@ -1455,7 +1477,9 @@ fn deprecated_direct() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF920 Hey this is a deprecated test rule.
|
||||
RUF920 Hey this is a deprecated test rule.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
|
||||
----- stderr -----
|
||||
@@ -1472,8 +1496,12 @@ fn deprecated_multiple_direct() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF920 Hey this is a deprecated test rule.
|
||||
-:1:1: RUF921 Hey this is another deprecated test rule.
|
||||
RUF920 Hey this is a deprecated test rule.
|
||||
--> -:1:1
|
||||
|
||||
RUF921 Hey this is another deprecated test rule.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
|
||||
----- stderr -----
|
||||
@@ -1491,8 +1519,12 @@ fn deprecated_indirect() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF920 Hey this is a deprecated test rule.
|
||||
-:1:1: RUF921 Hey this is another deprecated test rule.
|
||||
RUF920 Hey this is a deprecated test rule.
|
||||
--> -:1:1
|
||||
|
||||
RUF921 Hey this is another deprecated test rule.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
|
||||
----- stderr -----
|
||||
@@ -1638,22 +1670,23 @@ fn check_input_from_argfile() -> Result<()> {
|
||||
(file_a_path.display().to_string().as_str(), "/path/to/a.py"),
|
||||
]}, {
|
||||
assert_cmd_snapshot!(cmd
|
||||
.pass_stdin(""), @r###"
|
||||
.pass_stdin(""), @r"
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
/path/to/a.py:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> /path/to/a.py:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
Found 1 error.
|
||||
[*] 1 fixable with the `--fix` option.
|
||||
|
||||
----- stderr -----
|
||||
"###);
|
||||
");
|
||||
});
|
||||
|
||||
Ok(())
|
||||
@@ -1669,8 +1702,12 @@ fn check_hints_hidden_unsafe_fixes() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
[*] 1 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option).
|
||||
|
||||
@@ -1687,7 +1724,9 @@ fn check_hints_hidden_unsafe_fixes_with_no_safe_fixes() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
|
||||
|
||||
@@ -1705,8 +1744,12 @@ fn check_no_hint_for_hidden_unsafe_fixes_when_disabled() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
[*] 1 fixable with the --fix option.
|
||||
|
||||
@@ -1725,7 +1768,9 @@ fn check_no_hint_for_hidden_unsafe_fixes_with_no_safe_fixes_when_disabled() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
|
||||
----- stderr -----
|
||||
@@ -1742,8 +1787,12 @@ fn check_shows_unsafe_fixes_with_opt_in() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
-:1:1: RUF902 [*] Hey this is a stable test rule with an unsafe fix.
|
||||
RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF902 [*] Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
[*] 2 fixable with the --fix option.
|
||||
|
||||
@@ -1764,7 +1813,9 @@ fn fix_applies_safe_fixes_by_default() {
|
||||
# fix from stable-test-rule-safe-fix
|
||||
|
||||
----- stderr -----
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors (1 fixed, 1 remaining).
|
||||
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
|
||||
");
|
||||
@@ -1801,7 +1852,9 @@ fn fix_does_not_apply_display_only_fixes() {
|
||||
----- stdout -----
|
||||
def add_to_list(item, some_list=[]): ...
|
||||
----- stderr -----
|
||||
-:1:1: RUF903 Hey this is a stable test rule with a display only fix.
|
||||
RUF903 Hey this is a stable test rule with a display only fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
");
|
||||
}
|
||||
@@ -1819,7 +1872,9 @@ fn fix_does_not_apply_display_only_fixes_with_unsafe_fixes_enabled() {
|
||||
----- stdout -----
|
||||
def add_to_list(item, some_list=[]): ...
|
||||
----- stderr -----
|
||||
-:1:1: RUF903 Hey this is a stable test rule with a display only fix.
|
||||
RUF903 Hey this is a stable test rule with a display only fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
");
|
||||
}
|
||||
@@ -1836,7 +1891,9 @@ fn fix_only_unsafe_fixes_available() {
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 1 error.
|
||||
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
|
||||
");
|
||||
@@ -1972,8 +2029,12 @@ extend-unsafe-fixes = ["RUF901"]
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF901 Hey this is a stable test rule with a safe fix.
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF901 Hey this is a stable test rule with a safe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).
|
||||
|
||||
@@ -2004,8 +2065,12 @@ extend-safe-fixes = ["RUF902"]
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
-:1:1: RUF902 [*] Hey this is a stable test rule with an unsafe fix.
|
||||
RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF902 [*] Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
[*] 2 fixable with the `--fix` option.
|
||||
|
||||
@@ -2038,8 +2103,12 @@ extend-safe-fixes = ["RUF902"]
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
-:1:1: RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
RUF901 [*] Hey this is a stable test rule with a safe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF902 Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
Found 2 errors.
|
||||
[*] 1 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option).
|
||||
|
||||
@@ -2074,13 +2143,27 @@ extend-safe-fixes = ["RUF9"]
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:1:1: RUF900 Hey this is a stable test rule.
|
||||
-:1:1: RUF901 Hey this is a stable test rule with a safe fix.
|
||||
-:1:1: RUF902 [*] Hey this is a stable test rule with an unsafe fix.
|
||||
-:1:1: RUF903 Hey this is a stable test rule with a display only fix.
|
||||
-:1:1: RUF920 Hey this is a deprecated test rule.
|
||||
-:1:1: RUF921 Hey this is another deprecated test rule.
|
||||
-:1:1: RUF950 Hey this is a test rule that was redirected from another.
|
||||
RUF900 Hey this is a stable test rule.
|
||||
--> -:1:1
|
||||
|
||||
RUF901 Hey this is a stable test rule with a safe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF902 [*] Hey this is a stable test rule with an unsafe fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF903 Hey this is a stable test rule with a display only fix.
|
||||
--> -:1:1
|
||||
|
||||
RUF920 Hey this is a deprecated test rule.
|
||||
--> -:1:1
|
||||
|
||||
RUF921 Hey this is another deprecated test rule.
|
||||
--> -:1:1
|
||||
|
||||
RUF950 Hey this is a test rule that was redirected from another.
|
||||
--> -:1:1
|
||||
|
||||
Found 7 errors.
|
||||
[*] 1 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option).
|
||||
|
||||
@@ -2141,10 +2224,11 @@ def log(x, base) -> float:
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:2:5: D417 Missing argument description in the docstring for `log`: `base`
|
||||
D417 Missing argument description in the docstring for `log`: `base`
|
||||
--> -:2:5
|
||||
|
|
||||
2 | def log(x, base) -> float:
|
||||
| ^^^ D417
|
||||
| ^^^
|
||||
3 | """Calculate natural log of a value
|
||||
|
|
||||
|
||||
@@ -2177,14 +2261,15 @@ select = ["RUF017"]
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:3:1: RUF017 Avoid quadratic list summation
|
||||
RUF017 Avoid quadratic list summation
|
||||
--> -:3:1
|
||||
|
|
||||
1 | x = [1, 2, 3]
|
||||
2 | y = [4, 5, 6]
|
||||
3 | sum([x, y], [])
|
||||
| ^^^^^^^^^^^^^^^ RUF017
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Replace with `functools.reduce`
|
||||
help: Replace with `functools.reduce`
|
||||
|
||||
Found 1 error.
|
||||
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
|
||||
@@ -2217,14 +2302,15 @@ unfixable = ["RUF"]
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
-:3:1: RUF017 Avoid quadratic list summation
|
||||
RUF017 Avoid quadratic list summation
|
||||
--> -:3:1
|
||||
|
|
||||
1 | x = [1, 2, 3]
|
||||
2 | y = [4, 5, 6]
|
||||
3 | sum([x, y], [])
|
||||
| ^^^^^^^^^^^^^^^ RUF017
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Replace with `functools.reduce`
|
||||
help: Replace with `functools.reduce`
|
||||
|
||||
Found 1 error.
|
||||
|
||||
@@ -2246,10 +2332,11 @@ fn pyproject_toml_stdin_syntax_error() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
pyproject.toml:1:9: RUF200 Failed to parse pyproject.toml: unclosed table, expected `]`
|
||||
RUF200 Failed to parse pyproject.toml: unclosed table, expected `]`
|
||||
--> pyproject.toml:1:9
|
||||
|
|
||||
1 | [project
|
||||
| ^ RUF200
|
||||
| ^
|
||||
|
|
||||
|
||||
Found 1 error.
|
||||
@@ -2271,11 +2358,12 @@ fn pyproject_toml_stdin_schema_error() {
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
pyproject.toml:2:8: RUF200 Failed to parse pyproject.toml: invalid type: integer `1`, expected a string
|
||||
RUF200 Failed to parse pyproject.toml: invalid type: integer `1`, expected a string
|
||||
--> pyproject.toml:2:8
|
||||
|
|
||||
1 | [project]
|
||||
2 | name = 1
|
||||
| ^ RUF200
|
||||
| ^
|
||||
|
|
||||
|
||||
Found 1 error.
|
||||
@@ -2363,11 +2451,12 @@ fn pyproject_toml_stdin_schema_error_fix() {
|
||||
[project]
|
||||
name = 1
|
||||
----- stderr -----
|
||||
pyproject.toml:2:8: RUF200 Failed to parse pyproject.toml: invalid type: integer `1`, expected a string
|
||||
RUF200 Failed to parse pyproject.toml: invalid type: integer `1`, expected a string
|
||||
--> pyproject.toml:2:8
|
||||
|
|
||||
1 | [project]
|
||||
2 | name = 1
|
||||
| ^ RUF200
|
||||
| ^
|
||||
|
|
||||
|
||||
Found 1 error.
|
||||
|
||||
@@ -16,25 +16,28 @@ info:
|
||||
success: false
|
||||
exit_code: 1
|
||||
----- stdout -----
|
||||
input.py:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> input.py:1:8
|
||||
|
|
||||
1 | import os # F401
|
||||
| ^^ F401
|
||||
| ^^
|
||||
2 | x = y # F821
|
||||
3 | match 42: # invalid-syntax
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
input.py:2:5: F821 Undefined name `y`
|
||||
F821 Undefined name `y`
|
||||
--> input.py:2:5
|
||||
|
|
||||
1 | import os # F401
|
||||
2 | x = y # F821
|
||||
| ^ F821
|
||||
| ^
|
||||
3 | match 42: # invalid-syntax
|
||||
4 | case _: ...
|
||||
|
|
||||
|
||||
input.py:3:1: invalid-syntax: Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)
|
||||
invalid-syntax: Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)
|
||||
--> input.py:3:1
|
||||
|
|
||||
1 | import os # F401
|
||||
2 | x = y # F821
|
||||
|
||||
@@ -19,7 +19,7 @@ exit_code: 1
|
||||
[
|
||||
{
|
||||
"check_name": "F401",
|
||||
"description": "`os` imported but unused",
|
||||
"description": "F401: `os` imported but unused",
|
||||
"fingerprint": "4dbad37161e65c72",
|
||||
"location": {
|
||||
"path": "input.py",
|
||||
@@ -38,7 +38,7 @@ exit_code: 1
|
||||
},
|
||||
{
|
||||
"check_name": "F821",
|
||||
"description": "Undefined name `y`",
|
||||
"description": "F821: Undefined name `y`",
|
||||
"fingerprint": "7af59862a085230",
|
||||
"location": {
|
||||
"path": "input.py",
|
||||
@@ -56,8 +56,8 @@ exit_code: 1
|
||||
"severity": "major"
|
||||
},
|
||||
{
|
||||
"check_name": "syntax-error",
|
||||
"description": "Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)",
|
||||
"check_name": "invalid-syntax",
|
||||
"description": "invalid-syntax: Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)",
|
||||
"fingerprint": "e558cec859bb66e8",
|
||||
"location": {
|
||||
"path": "input.py",
|
||||
|
||||
@@ -1201,11 +1201,16 @@ fn format_snippet<'m>(
|
||||
|
||||
let is_file_level = snippet.annotations.iter().any(|ann| ann.is_file_level);
|
||||
if is_file_level {
|
||||
assert!(
|
||||
snippet.source.is_empty(),
|
||||
"Non-empty file-level snippet that won't be rendered: {:?}",
|
||||
snippet.source
|
||||
);
|
||||
// TODO(brent) enable this assertion again once we set `is_file_level` for individual rules.
|
||||
// It's causing too many false positives currently when the default is to make any
|
||||
// annotation with a default range file-level. See
|
||||
// https://github.com/astral-sh/ruff/issues/19688.
|
||||
//
|
||||
// assert!(
|
||||
// snippet.source.is_empty(),
|
||||
// "Non-empty file-level snippet that won't be rendered: {:?}",
|
||||
// snippet.source
|
||||
// );
|
||||
let header = format_header(origin, main_range, &[], is_first, snippet.cell_index);
|
||||
return DisplaySet {
|
||||
display_lines: header.map_or_else(Vec::new, |header| vec![header]),
|
||||
@@ -1273,13 +1278,20 @@ fn format_header<'a>(
|
||||
..
|
||||
} = item
|
||||
{
|
||||
if main_range >= range.0 && main_range < range.1 + max(*end_line as usize, 1) {
|
||||
// At the very end of the `main_range`, report the location as the first character
|
||||
// in the next line instead of falling back to the default location of `1:1`. This
|
||||
// is another divergence from upstream.
|
||||
let end_of_range = range.1 + max(*end_line as usize, 1);
|
||||
if main_range >= range.0 && main_range < end_of_range {
|
||||
let char_column = text[0..(main_range - range.0).min(text.len())]
|
||||
.chars()
|
||||
.count();
|
||||
col = char_column + 1;
|
||||
line_offset = lineno.unwrap_or(1);
|
||||
break;
|
||||
} else if main_range == end_of_range {
|
||||
line_offset = lineno.map_or(1, |line| line + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,5 +86,5 @@ walltime = ["ruff_db/os", "ty_project", "divan"]
|
||||
[target.'cfg(target_os = "windows")'.dev-dependencies]
|
||||
mimalloc = { workspace = true }
|
||||
|
||||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64")))'.dev-dependencies]
|
||||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64", target_arch = "riscv64")))'.dev-dependencies]
|
||||
tikv-jemallocator = { workspace = true }
|
||||
|
||||
@@ -21,7 +21,8 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
any(
|
||||
target_arch = "x86_64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "powerpc64"
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv64"
|
||||
)
|
||||
))]
|
||||
#[global_allocator]
|
||||
|
||||
@@ -18,7 +18,8 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
any(
|
||||
target_arch = "x86_64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "powerpc64"
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv64"
|
||||
)
|
||||
))]
|
||||
#[global_allocator]
|
||||
|
||||
@@ -26,7 +26,8 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
any(
|
||||
target_arch = "x86_64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "powerpc64"
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv64"
|
||||
)
|
||||
))]
|
||||
#[global_allocator]
|
||||
@@ -42,7 +43,8 @@ static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
||||
any(
|
||||
target_arch = "x86_64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "powerpc64"
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv64"
|
||||
)
|
||||
))]
|
||||
#[unsafe(export_name = "_rjem_malloc_conf")]
|
||||
@@ -77,8 +79,11 @@ fn benchmark_linter(mut group: BenchmarkGroup, settings: &LinterSettings) {
|
||||
b.iter_batched(
|
||||
|| parsed.clone(),
|
||||
|parsed| {
|
||||
// Assert that file contains no parse errors
|
||||
assert!(parsed.has_valid_syntax());
|
||||
|
||||
let path = case.path();
|
||||
let result = lint_only(
|
||||
lint_only(
|
||||
&path,
|
||||
None,
|
||||
settings,
|
||||
@@ -86,10 +91,7 @@ fn benchmark_linter(mut group: BenchmarkGroup, settings: &LinterSettings) {
|
||||
&SourceKind::Python(case.code().to_string()),
|
||||
PySourceType::from(path.as_path()),
|
||||
ParseSource::Precomputed(parsed),
|
||||
);
|
||||
|
||||
// Assert that file contains no parse errors
|
||||
assert!(!result.has_syntax_errors());
|
||||
)
|
||||
},
|
||||
criterion::BatchSize::SmallInput,
|
||||
);
|
||||
|
||||
@@ -20,7 +20,8 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
any(
|
||||
target_arch = "x86_64",
|
||||
target_arch = "aarch64",
|
||||
target_arch = "powerpc64"
|
||||
target_arch = "powerpc64",
|
||||
target_arch = "riscv64"
|
||||
)
|
||||
))]
|
||||
#[global_allocator]
|
||||
|
||||
@@ -218,6 +218,24 @@ static TANJUN: std::sync::LazyLock<Benchmark<'static>> = std::sync::LazyLock::ne
|
||||
)
|
||||
});
|
||||
|
||||
static STATIC_FRAME: std::sync::LazyLock<Benchmark<'static>> = std::sync::LazyLock::new(|| {
|
||||
Benchmark::new(
|
||||
RealWorldProject {
|
||||
name: "static-frame",
|
||||
repository: "https://github.com/static-frame/static-frame",
|
||||
commit: "34962b41baca5e7f98f5a758d530bff02748a421",
|
||||
paths: vec![SystemPath::new("static_frame")],
|
||||
// N.B. `arraykit` is installed as a dependency during mypy_primer runs,
|
||||
// but it takes much longer to be installed in a Codspeed run than it does in a mypy_primer run
|
||||
// (seems to be built from source on the Codspeed CI runners for some reason).
|
||||
dependencies: vec!["numpy"],
|
||||
max_dep_date: "2025-08-09",
|
||||
python_version: PythonVersion::PY311,
|
||||
},
|
||||
500,
|
||||
)
|
||||
});
|
||||
|
||||
#[track_caller]
|
||||
fn run_single_threaded(bencher: Bencher, benchmark: &Benchmark) {
|
||||
bencher
|
||||
@@ -232,7 +250,7 @@ fn small(bencher: Bencher, benchmark: &Benchmark) {
|
||||
run_single_threaded(bencher, benchmark);
|
||||
}
|
||||
|
||||
#[bench(args=[&*COLOUR_SCIENCE, &*PANDAS], sample_size=1, sample_count=3)]
|
||||
#[bench(args=[&*COLOUR_SCIENCE, &*PANDAS, &*STATIC_FRAME], sample_size=1, sample_count=3)]
|
||||
fn medium(bencher: Bencher, benchmark: &Benchmark) {
|
||||
run_single_threaded(bencher, benchmark);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ use std::borrow::Cow;
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::Path;
|
||||
|
||||
use full::FullRenderer;
|
||||
use ruff_annotate_snippets::{
|
||||
Annotation as AnnotateAnnotation, Level as AnnotateLevel, Message as AnnotateMessage,
|
||||
Renderer as AnnotateRenderer, Snippet as AnnotateSnippet,
|
||||
Snippet as AnnotateSnippet,
|
||||
};
|
||||
use ruff_notebook::{Notebook, NotebookIndex};
|
||||
use ruff_source_file::{LineIndex, OneIndexed, SourceCode};
|
||||
use ruff_text_size::{TextLen, TextRange, TextSize};
|
||||
|
||||
use crate::diagnostic::stylesheet::DiagnosticStylesheet;
|
||||
use crate::{
|
||||
Db,
|
||||
files::File,
|
||||
@@ -111,37 +111,7 @@ impl std::fmt::Display for DisplayDiagnostics<'_> {
|
||||
ConciseRenderer::new(self.resolver, self.config).render(f, self.diagnostics)?;
|
||||
}
|
||||
DiagnosticFormat::Full => {
|
||||
let stylesheet = if self.config.color {
|
||||
DiagnosticStylesheet::styled()
|
||||
} else {
|
||||
DiagnosticStylesheet::plain()
|
||||
};
|
||||
|
||||
let mut renderer = if self.config.color {
|
||||
AnnotateRenderer::styled()
|
||||
} else {
|
||||
AnnotateRenderer::plain()
|
||||
}
|
||||
.cut_indicator("…");
|
||||
|
||||
renderer = renderer
|
||||
.error(stylesheet.error)
|
||||
.warning(stylesheet.warning)
|
||||
.info(stylesheet.info)
|
||||
.note(stylesheet.note)
|
||||
.help(stylesheet.help)
|
||||
.line_no(stylesheet.line_no)
|
||||
.emphasis(stylesheet.emphasis)
|
||||
.none(stylesheet.none);
|
||||
|
||||
for diag in self.diagnostics {
|
||||
let resolved = Resolved::new(self.resolver, diag, self.config);
|
||||
let renderable = resolved.to_renderable(self.config.context);
|
||||
for diag in renderable.diagnostics.iter() {
|
||||
writeln!(f, "{}", renderer.render(diag.to_annotate()))?;
|
||||
}
|
||||
writeln!(f)?;
|
||||
}
|
||||
FullRenderer::new(self.resolver, self.config).render(f, self.diagnostics)?;
|
||||
}
|
||||
DiagnosticFormat::Azure => {
|
||||
AzureRenderer::new(self.resolver).render(f, self.diagnostics)?;
|
||||
@@ -242,7 +212,12 @@ impl<'a> ResolvedDiagnostic<'a> {
|
||||
.annotations
|
||||
.iter()
|
||||
.filter_map(|ann| {
|
||||
let path = ann.span.file.path(resolver);
|
||||
let path = ann
|
||||
.span
|
||||
.file
|
||||
.relative_path(resolver)
|
||||
.to_str()
|
||||
.unwrap_or_else(|| ann.span.file.path(resolver));
|
||||
let diagnostic_source = ann.span.file.diagnostic_source(resolver);
|
||||
ResolvedAnnotation::new(path, &diagnostic_source, ann, resolver)
|
||||
})
|
||||
@@ -655,6 +630,22 @@ impl<'r> RenderableSnippet<'r> {
|
||||
.as_source_code()
|
||||
.slice(TextRange::new(snippet_start, snippet_end));
|
||||
|
||||
// Strip the BOM from the beginning of the snippet, if present. Doing this here saves us the
|
||||
// trouble of updating the annotation ranges in `replace_unprintable`, and also allows us to
|
||||
// check that the BOM is at the very beginning of the file, not just the beginning of the
|
||||
// snippet.
|
||||
const BOM: char = '\u{feff}';
|
||||
let bom_len = BOM.text_len();
|
||||
let (snippet, snippet_start) =
|
||||
if snippet_start == TextSize::ZERO && snippet.starts_with(BOM) {
|
||||
(
|
||||
&snippet[bom_len.to_usize()..],
|
||||
snippet_start + TextSize::new(bom_len.to_u32()),
|
||||
)
|
||||
} else {
|
||||
(snippet, snippet_start)
|
||||
};
|
||||
|
||||
let annotations = anns
|
||||
.iter()
|
||||
.map(|ann| RenderableAnnotation::new(snippet_start, ann))
|
||||
@@ -719,7 +710,11 @@ impl<'r> RenderableAnnotation<'r> {
|
||||
/// lifetime parameter here refers to the lifetime of the resolver that
|
||||
/// created the given `ResolvedAnnotation`.
|
||||
fn new(snippet_start: TextSize, ann: &'_ ResolvedAnnotation<'r>) -> RenderableAnnotation<'r> {
|
||||
let range = ann.range - snippet_start;
|
||||
// This should only ever saturate if a BOM is present _and_ the annotation range points
|
||||
// before the BOM (i.e. at offset 0). In Ruff this typically results from the use of
|
||||
// `TextRange::default()` for a diagnostic range instead of a range relative to file
|
||||
// contents.
|
||||
let range = ann.range.checked_sub(snippet_start).unwrap_or(ann.range);
|
||||
RenderableAnnotation {
|
||||
range,
|
||||
message: ann.message,
|
||||
@@ -1000,7 +995,12 @@ fn replace_unprintable<'r>(
|
||||
let mut last_end = 0;
|
||||
let mut result = String::new();
|
||||
for (index, c) in source.char_indices() {
|
||||
if let Some(printable) = unprintable_replacement(c) {
|
||||
// normalize `\r` line endings but don't double `\r\n`
|
||||
if c == '\r' && !source[index + 1..].starts_with("\n") {
|
||||
result.push_str(&source[last_end..index]);
|
||||
result.push('\n');
|
||||
last_end = index + 1;
|
||||
} else if let Some(printable) = unprintable_replacement(c) {
|
||||
result.push_str(&source[last_end..index]);
|
||||
|
||||
let len = printable.text_len().to_u32();
|
||||
|
||||
@@ -1,7 +1,63 @@
|
||||
use ruff_annotate_snippets::Renderer as AnnotateRenderer;
|
||||
|
||||
use crate::diagnostic::render::{FileResolver, Resolved};
|
||||
use crate::diagnostic::{Diagnostic, DisplayDiagnosticConfig, stylesheet::DiagnosticStylesheet};
|
||||
|
||||
pub(super) struct FullRenderer<'a> {
|
||||
resolver: &'a dyn FileResolver,
|
||||
config: &'a DisplayDiagnosticConfig,
|
||||
}
|
||||
|
||||
impl<'a> FullRenderer<'a> {
|
||||
pub(super) fn new(resolver: &'a dyn FileResolver, config: &'a DisplayDiagnosticConfig) -> Self {
|
||||
Self { resolver, config }
|
||||
}
|
||||
|
||||
pub(super) fn render(
|
||||
&self,
|
||||
f: &mut std::fmt::Formatter,
|
||||
diagnostics: &[Diagnostic],
|
||||
) -> std::fmt::Result {
|
||||
let stylesheet = if self.config.color {
|
||||
DiagnosticStylesheet::styled()
|
||||
} else {
|
||||
DiagnosticStylesheet::plain()
|
||||
};
|
||||
|
||||
let mut renderer = if self.config.color {
|
||||
AnnotateRenderer::styled()
|
||||
} else {
|
||||
AnnotateRenderer::plain()
|
||||
}
|
||||
.cut_indicator("…");
|
||||
|
||||
renderer = renderer
|
||||
.error(stylesheet.error)
|
||||
.warning(stylesheet.warning)
|
||||
.info(stylesheet.info)
|
||||
.note(stylesheet.note)
|
||||
.help(stylesheet.help)
|
||||
.line_no(stylesheet.line_no)
|
||||
.emphasis(stylesheet.emphasis)
|
||||
.none(stylesheet.none);
|
||||
|
||||
for diag in diagnostics {
|
||||
let resolved = Resolved::new(self.resolver, diag, self.config);
|
||||
let renderable = resolved.to_renderable(self.config.context);
|
||||
for diag in renderable.diagnostics.iter() {
|
||||
writeln!(f, "{}", renderer.render(diag.to_annotate()))?;
|
||||
}
|
||||
writeln!(f)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ruff_diagnostics::Applicability;
|
||||
use ruff_text_size::TextRange;
|
||||
use ruff_text_size::{TextLen, TextRange, TextSize};
|
||||
|
||||
use crate::diagnostic::{
|
||||
Annotation, DiagnosticFormat, Severity,
|
||||
@@ -186,7 +242,7 @@ print()
|
||||
/// For example, without the fix, we get diagnostics like this:
|
||||
///
|
||||
/// ```
|
||||
/// error[invalid-character-sub]: Invalid unescaped character SUB, use "\x1A" instead
|
||||
/// error[invalid-character-sub]: Invalid unescaped character SUB, use "\x1a" instead
|
||||
/// --> example.py:1:25
|
||||
/// |
|
||||
/// 1 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
||||
@@ -206,13 +262,13 @@ print()
|
||||
.builder(
|
||||
"invalid-character-sub",
|
||||
Severity::Error,
|
||||
r#"Invalid unescaped character SUB, use "\x1A" instead"#,
|
||||
r#"Invalid unescaped character SUB, use "\x1a" instead"#,
|
||||
)
|
||||
.primary("example.py", "1:24", "1:24", "")
|
||||
.build();
|
||||
|
||||
insta::assert_snapshot!(env.render(&diagnostic), @r#"
|
||||
error[invalid-character-sub]: Invalid unescaped character SUB, use "\x1A" instead
|
||||
error[invalid-character-sub]: Invalid unescaped character SUB, use "\x1a" instead
|
||||
--> example.py:1:25
|
||||
|
|
||||
1 | nested_fstrings = f'␈{f'{f'␛'}'}'
|
||||
@@ -231,13 +287,13 @@ print()
|
||||
.builder(
|
||||
"invalid-character-sub",
|
||||
Severity::Error,
|
||||
r#"Invalid unescaped character SUB, use "\x1A" instead"#,
|
||||
r#"Invalid unescaped character SUB, use "\x1a" instead"#,
|
||||
)
|
||||
.primary("example.py", "1:1", "1:1", "")
|
||||
.build();
|
||||
|
||||
insta::assert_snapshot!(env.render(&diagnostic), @r#"
|
||||
error[invalid-character-sub]: Invalid unescaped character SUB, use "\x1A" instead
|
||||
error[invalid-character-sub]: Invalid unescaped character SUB, use "\x1a" instead
|
||||
--> example.py:1:2
|
||||
|
|
||||
1 | ␈␛
|
||||
@@ -400,4 +456,107 @@ print()
|
||||
help: Remove `print` statement
|
||||
");
|
||||
}
|
||||
|
||||
/// Carriage return (`\r`) is a valid line-ending in Python, so we should normalize this to a
|
||||
/// line feed (`\n`) for rendering. Otherwise we report a single long line for this case.
|
||||
#[test]
|
||||
fn normalize_carriage_return() {
|
||||
let mut env = TestEnvironment::new();
|
||||
env.add(
|
||||
"example.py",
|
||||
"# Keep parenthesis around preserved CR\rint(-\r 1)\rint(+\r 1)",
|
||||
);
|
||||
env.format(DiagnosticFormat::Full);
|
||||
|
||||
let mut diagnostic = env.err().build();
|
||||
let span = env
|
||||
.path("example.py")
|
||||
.with_range(TextRange::at(TextSize::new(39), TextSize::new(0)));
|
||||
let annotation = Annotation::primary(span);
|
||||
diagnostic.annotate(annotation);
|
||||
|
||||
insta::assert_snapshot!(env.render(&diagnostic), @r"
|
||||
error[test-diagnostic]: main diagnostic message
|
||||
--> example.py:2:1
|
||||
|
|
||||
1 | # Keep parenthesis around preserved CR
|
||||
2 | int(-
|
||||
| ^
|
||||
3 | 1)
|
||||
4 | int(+
|
||||
|
|
||||
");
|
||||
}
|
||||
|
||||
/// Without stripping the BOM, we report an error in column 2, unlike Ruff.
|
||||
#[test]
|
||||
fn strip_bom() {
|
||||
let mut env = TestEnvironment::new();
|
||||
env.add("example.py", "\u{feff}import foo");
|
||||
env.format(DiagnosticFormat::Full);
|
||||
|
||||
let mut diagnostic = env.err().build();
|
||||
let span = env
|
||||
.path("example.py")
|
||||
.with_range(TextRange::at(TextSize::new(3), TextSize::new(0)));
|
||||
let annotation = Annotation::primary(span);
|
||||
diagnostic.annotate(annotation);
|
||||
|
||||
insta::assert_snapshot!(env.render(&diagnostic), @r"
|
||||
error[test-diagnostic]: main diagnostic message
|
||||
--> example.py:1:1
|
||||
|
|
||||
1 | import foo
|
||||
| ^
|
||||
|
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bom_with_default_range() {
|
||||
let mut env = TestEnvironment::new();
|
||||
env.add("example.py", "\u{feff}import foo");
|
||||
env.format(DiagnosticFormat::Full);
|
||||
|
||||
let mut diagnostic = env.err().build();
|
||||
let span = env.path("example.py").with_range(TextRange::default());
|
||||
let annotation = Annotation::primary(span);
|
||||
diagnostic.annotate(annotation);
|
||||
|
||||
insta::assert_snapshot!(env.render(&diagnostic), @r"
|
||||
error[test-diagnostic]: main diagnostic message
|
||||
--> example.py:1:1
|
||||
|
|
||||
1 | import foo
|
||||
| ^
|
||||
|
|
||||
");
|
||||
}
|
||||
|
||||
/// We previously rendered this correctly, but the header was falling back to 1:1 for ranges
|
||||
/// pointing to the final newline in a file. Like Ruff, we now use the offset of the first
|
||||
/// character in the nonexistent final line in the header.
|
||||
#[test]
|
||||
fn end_of_file() {
|
||||
let mut env = TestEnvironment::new();
|
||||
let contents = "unexpected eof\n";
|
||||
env.add("example.py", contents);
|
||||
env.format(DiagnosticFormat::Full);
|
||||
|
||||
let mut diagnostic = env.err().build();
|
||||
let span = env
|
||||
.path("example.py")
|
||||
.with_range(TextRange::at(contents.text_len(), TextSize::new(0)));
|
||||
let annotation = Annotation::primary(span);
|
||||
diagnostic.annotate(annotation);
|
||||
|
||||
insta::assert_snapshot!(env.render(&diagnostic), @r"
|
||||
error[test-diagnostic]: main diagnostic message
|
||||
--> example.py:2:1
|
||||
|
|
||||
1 | unexpected eof
|
||||
| ^
|
||||
|
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::system::file_time_now;
|
||||
/// * The last modification time of the file.
|
||||
/// * The hash of the file's content.
|
||||
/// * The revision as it comes from an external system, for example the LSP.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default, get_size2::GetSize)]
|
||||
pub struct FileRevision(u128);
|
||||
|
||||
impl FileRevision {
|
||||
|
||||
@@ -289,7 +289,7 @@ impl std::panic::RefUnwindSafe for Files {}
|
||||
/// # Ordering
|
||||
/// Ordering is based on the file's salsa-assigned id and not on its values.
|
||||
/// The id may change between runs.
|
||||
#[salsa::input]
|
||||
#[salsa::input(heap_size=ruff_memory_usage::heap_size)]
|
||||
#[derive(PartialOrd, Ord)]
|
||||
pub struct File {
|
||||
/// The path of the file (immutable).
|
||||
@@ -521,7 +521,7 @@ impl VirtualFile {
|
||||
// The types in here need to be public because they're salsa ingredients but we
|
||||
// don't want them to be publicly accessible. That's why we put them into a private module.
|
||||
mod private {
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default, get_size2::GetSize)]
|
||||
pub enum FileStatus {
|
||||
/// The file exists.
|
||||
#[default]
|
||||
|
||||
@@ -16,7 +16,7 @@ use crate::system::{SystemPath, SystemPathBuf};
|
||||
/// The main usage of file roots is to determine a file's durability. But it can also be used
|
||||
/// to make a salsa query dependent on whether a file in a root has changed without writing any
|
||||
/// manual invalidation logic.
|
||||
#[salsa::input(debug)]
|
||||
#[salsa::input(debug, heap_size=ruff_memory_usage::heap_size)]
|
||||
pub struct FileRoot {
|
||||
/// The path of a root is guaranteed to never change.
|
||||
#[returns(deref)]
|
||||
@@ -37,7 +37,7 @@ impl FileRoot {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, get_size2::GetSize)]
|
||||
pub enum FileRootKind {
|
||||
/// The root of a project.
|
||||
Project,
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::fmt::{Display, Formatter};
|
||||
/// * a file stored on the [host system](crate::system::System).
|
||||
/// * a virtual file stored on the [host system](crate::system::System).
|
||||
/// * a vendored file stored in the [vendored file system](crate::vendored::VendoredFileSystem).
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, get_size2::GetSize)]
|
||||
pub enum FilePath {
|
||||
/// Path to a file on the [host system](crate::system::System).
|
||||
System(SystemPathBuf),
|
||||
|
||||
@@ -762,7 +762,7 @@ impl SystemVirtualPath {
|
||||
}
|
||||
|
||||
/// An owned, virtual path on [`System`](`super::System`) (akin to [`String`]).
|
||||
#[derive(Eq, PartialEq, Clone, Hash, PartialOrd, Ord)]
|
||||
#[derive(Eq, PartialEq, Clone, Hash, PartialOrd, Ord, get_size2::GetSize)]
|
||||
pub struct SystemVirtualPathBuf(String);
|
||||
|
||||
impl SystemVirtualPathBuf {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ruff_linter"
|
||||
version = "0.12.8"
|
||||
version = "0.12.9"
|
||||
publish = false
|
||||
authors = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
@@ -13,7 +13,6 @@ license = { workspace = true }
|
||||
[lib]
|
||||
|
||||
[dependencies]
|
||||
ruff_annotate_snippets = { workspace = true }
|
||||
ruff_cache = { workspace = true }
|
||||
ruff_db = { workspace = true, features = ["junit", "serde"] }
|
||||
ruff_diagnostics = { workspace = true, features = ["serde"] }
|
||||
|
||||
@@ -13,6 +13,7 @@ from airflow.api_connexion.security import requires_access
|
||||
from airflow.contrib.aws_athena_hook import AWSAthenaHook
|
||||
from airflow.datasets import DatasetAliasEvent
|
||||
from airflow.operators.subdag import SubDagOperator
|
||||
from airflow.secrets.cache import SecretCache
|
||||
from airflow.secrets.local_filesystem import LocalFilesystemBackend
|
||||
from airflow.triggers.external_task import TaskStateTrigger
|
||||
from airflow.utils import dates
|
||||
@@ -56,6 +57,9 @@ SubDagOperator()
|
||||
# get_connection
|
||||
LocalFilesystemBackend()
|
||||
|
||||
# airflow.secrets.cache
|
||||
SecretCache()
|
||||
|
||||
|
||||
# airflow.triggers.external_task
|
||||
TaskStateTrigger()
|
||||
|
||||
@@ -154,6 +154,11 @@ try:
|
||||
except Exception as e:
|
||||
raise ValueError from e
|
||||
|
||||
try:
|
||||
...
|
||||
except Exception as e:
|
||||
raise e from ValueError("hello")
|
||||
|
||||
|
||||
try:
|
||||
pass
|
||||
@@ -245,3 +250,9 @@ try:
|
||||
pass
|
||||
except (Exception, ValueError) as e:
|
||||
raise e
|
||||
|
||||
# `from None` cause
|
||||
try:
|
||||
pass
|
||||
except BaseException as e:
|
||||
raise e from None
|
||||
|
||||
43
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C420_3.py
vendored
Normal file
43
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C420_3.py
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
class C: a = None
|
||||
{C.a: None for C.a in "abc"}
|
||||
print(C.a)
|
||||
|
||||
x = [None]
|
||||
{x[0]: None for x[0] in "abc"}
|
||||
print(x)
|
||||
|
||||
class C(list):
|
||||
def __getitem__(self, index, /):
|
||||
item = super().__getitem__(index)
|
||||
if isinstance(index, slice): item = tuple(item)
|
||||
return item
|
||||
x = C()
|
||||
{x[:0]: None for x[:0] in "abc"}
|
||||
print(x)
|
||||
|
||||
|
||||
class C:
|
||||
a = None
|
||||
|
||||
def func():
|
||||
{(C.a,): None for (C.a,) in "abc"} # OK
|
||||
|
||||
|
||||
def func():
|
||||
obj = type('obj', (), {'attr': 1})()
|
||||
{(obj.attr,): None for (obj.attr,) in "abc"} # OK
|
||||
|
||||
|
||||
def func():
|
||||
lst = [1, 2, 3]
|
||||
{(lst[0],): None for (lst[0],) in "abc"} # OK
|
||||
|
||||
|
||||
def func():
|
||||
lst = [1, 2, 3, 4, 5]
|
||||
{(lst[1:3],): None for (lst[1:3],) in "abc"} # OK
|
||||
|
||||
|
||||
# C420: side-effecting assignment targets
|
||||
# These should NOT trigger C420 because they have side-effecting assignment targets
|
||||
# See https://github.com/astral-sh/ruff/issues/19511
|
||||
@@ -161,3 +161,8 @@ r"""first
|
||||
'no need' to escape
|
||||
"swap" quote style
|
||||
"use' ugly triple quotes""".split("\n")
|
||||
|
||||
# https://github.com/astral-sh/ruff/issues/19845
|
||||
print("S\x1cP\x1dL\x1eI\x1fT".split())
|
||||
print("\x1c\x1d\x1e\x1f>".split(maxsplit=0))
|
||||
print("<\x1c\x1d\x1e\x1f".rsplit(maxsplit=0))
|
||||
|
||||
@@ -51,3 +51,11 @@ dbm.ndbm.open("db", "r", 0o600) # OK
|
||||
|
||||
os.fchmod(0, 256) # 0o400
|
||||
os.fchmod(0, 493) # 0o755
|
||||
|
||||
# https://github.com/astral-sh/ruff/issues/19010
|
||||
os.chmod("foo", 000) # Error
|
||||
os.chmod("foo", 0000) # Error
|
||||
|
||||
os.chmod("foo", 0b0) # Error
|
||||
os.chmod("foo", 0x0) # Error
|
||||
os.chmod("foo", 0) # Ok
|
||||
|
||||
@@ -684,8 +684,7 @@ impl SemanticSyntaxContext for Checker<'_> {
|
||||
| SemanticSyntaxErrorKind::LoadBeforeNonlocalDeclaration { .. }
|
||||
| SemanticSyntaxErrorKind::NonlocalAndGlobal(_)
|
||||
| SemanticSyntaxErrorKind::AnnotatedGlobal(_)
|
||||
| SemanticSyntaxErrorKind::AnnotatedNonlocal(_)
|
||||
| SemanticSyntaxErrorKind::NoBindingForNonlocal(_) => {
|
||||
| SemanticSyntaxErrorKind::AnnotatedNonlocal(_) => {
|
||||
self.semantic_errors.borrow_mut().push(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,44 +44,15 @@ pub struct LinterResult {
|
||||
/// Flag indicating that the parsed source code does not contain any
|
||||
/// [`ParseError`]s
|
||||
has_valid_syntax: bool,
|
||||
/// Flag indicating that the parsed source code does not contain any [`ParseError`]s,
|
||||
/// [`UnsupportedSyntaxError`]s, or [`SemanticSyntaxError`]s.
|
||||
has_no_syntax_errors: bool,
|
||||
}
|
||||
|
||||
impl LinterResult {
|
||||
/// Returns `true` if the parsed source code contains any [`ParseError`]s *or*
|
||||
/// [`UnsupportedSyntaxError`]s.
|
||||
///
|
||||
/// See [`LinterResult::has_invalid_syntax`] for a version specific to [`ParseError`]s.
|
||||
pub fn has_syntax_errors(&self) -> bool {
|
||||
!self.has_no_syntax_errors()
|
||||
}
|
||||
|
||||
/// Returns `true` if the parsed source code does not contain any [`ParseError`]s *or*
|
||||
/// [`UnsupportedSyntaxError`]s.
|
||||
///
|
||||
/// See [`LinterResult::has_valid_syntax`] for a version specific to [`ParseError`]s.
|
||||
pub fn has_no_syntax_errors(&self) -> bool {
|
||||
self.has_valid_syntax() && self.has_no_syntax_errors
|
||||
}
|
||||
|
||||
/// Returns `true` if the parsed source code is valid i.e., it has no [`ParseError`]s.
|
||||
///
|
||||
/// Note that this does not include version-related [`UnsupportedSyntaxError`]s.
|
||||
///
|
||||
/// See [`LinterResult::has_no_syntax_errors`] for a version that takes these into account.
|
||||
pub fn has_valid_syntax(&self) -> bool {
|
||||
self.has_valid_syntax
|
||||
}
|
||||
|
||||
/// Returns `true` if the parsed source code is invalid i.e., it has [`ParseError`]s.
|
||||
///
|
||||
/// Note that this does not include version-related [`UnsupportedSyntaxError`]s.
|
||||
///
|
||||
/// See [`LinterResult::has_no_syntax_errors`] for a version that takes these into account.
|
||||
/// Note that this does not include version-related [`UnsupportedSyntaxError`]s or
|
||||
/// [`SemanticSyntaxError`]s.
|
||||
pub fn has_invalid_syntax(&self) -> bool {
|
||||
!self.has_valid_syntax()
|
||||
!self.has_valid_syntax
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,7 +484,6 @@ pub fn lint_only(
|
||||
|
||||
LinterResult {
|
||||
has_valid_syntax: parsed.has_valid_syntax(),
|
||||
has_no_syntax_errors: !diagnostics.iter().any(Diagnostic::is_invalid_syntax),
|
||||
diagnostics,
|
||||
}
|
||||
}
|
||||
@@ -670,7 +640,6 @@ pub fn lint_fix<'a>(
|
||||
result: LinterResult {
|
||||
diagnostics,
|
||||
has_valid_syntax,
|
||||
has_no_syntax_errors,
|
||||
},
|
||||
transformed,
|
||||
fixed,
|
||||
|
||||
@@ -88,20 +88,14 @@ impl Serialize for SerializedMessages<'_> {
|
||||
}
|
||||
fingerprints.insert(message_fingerprint);
|
||||
|
||||
let (description, check_name) = if let Some(code) = diagnostic.secondary_code() {
|
||||
(diagnostic.body().to_string(), code.as_str())
|
||||
} else {
|
||||
let description = diagnostic.body();
|
||||
let description_without_prefix = description
|
||||
.strip_prefix("SyntaxError: ")
|
||||
.unwrap_or(description);
|
||||
|
||||
(description_without_prefix.to_string(), "syntax-error")
|
||||
};
|
||||
let description = diagnostic.body();
|
||||
let check_name = diagnostic.secondary_code_or_id();
|
||||
|
||||
let value = json!({
|
||||
"check_name": check_name,
|
||||
"description": description,
|
||||
// GitLab doesn't display the separate `check_name` field in a Code Quality report,
|
||||
// so prepend it to the description too.
|
||||
"description": format!("{check_name}: {description}"),
|
||||
"severity": "major",
|
||||
"fingerprint": format!("{:x}", message_fingerprint),
|
||||
"location": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use std::collections::BTreeMap;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::io::Write;
|
||||
use std::num::NonZeroUsize;
|
||||
@@ -6,18 +7,16 @@ use colored::Colorize;
|
||||
|
||||
use ruff_db::diagnostic::Diagnostic;
|
||||
use ruff_notebook::NotebookIndex;
|
||||
use ruff_source_file::OneIndexed;
|
||||
use ruff_source_file::{LineColumn, OneIndexed};
|
||||
|
||||
use crate::fs::relativize_path;
|
||||
use crate::message::diff::calculate_print_width;
|
||||
use crate::message::text::{MessageCodeFrame, RuleCodeAndBody};
|
||||
use crate::message::{Emitter, EmitterContext, MessageWithLocation, group_diagnostics_by_filename};
|
||||
use crate::message::{Emitter, EmitterContext};
|
||||
use crate::settings::types::UnsafeFixes;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct GroupedEmitter {
|
||||
show_fix_status: bool,
|
||||
show_source: bool,
|
||||
unsafe_fixes: UnsafeFixes,
|
||||
}
|
||||
|
||||
@@ -28,12 +27,6 @@ impl GroupedEmitter {
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_show_source(mut self, show_source: bool) -> Self {
|
||||
self.show_source = show_source;
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_unsafe_fixes(mut self, unsafe_fixes: UnsafeFixes) -> Self {
|
||||
self.unsafe_fixes = unsafe_fixes;
|
||||
@@ -76,29 +69,53 @@ impl Emitter for GroupedEmitter {
|
||||
message,
|
||||
show_fix_status: self.show_fix_status,
|
||||
unsafe_fixes: self.unsafe_fixes,
|
||||
show_source: self.show_source,
|
||||
row_length,
|
||||
column_length,
|
||||
}
|
||||
)?;
|
||||
}
|
||||
|
||||
// Print a blank line between files, unless we're showing the source, in which case
|
||||
// we'll have already printed a blank line between messages.
|
||||
if !self.show_source {
|
||||
writeln!(writer)?;
|
||||
}
|
||||
// Print a blank line between files.
|
||||
writeln!(writer)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
struct MessageWithLocation<'a> {
|
||||
message: &'a Diagnostic,
|
||||
start_location: LineColumn,
|
||||
}
|
||||
|
||||
impl std::ops::Deref for MessageWithLocation<'_> {
|
||||
type Target = Diagnostic;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
self.message
|
||||
}
|
||||
}
|
||||
|
||||
fn group_diagnostics_by_filename(
|
||||
diagnostics: &[Diagnostic],
|
||||
) -> BTreeMap<String, Vec<MessageWithLocation<'_>>> {
|
||||
let mut grouped_messages = BTreeMap::default();
|
||||
for diagnostic in diagnostics {
|
||||
grouped_messages
|
||||
.entry(diagnostic.expect_ruff_filename())
|
||||
.or_insert_with(Vec::new)
|
||||
.push(MessageWithLocation {
|
||||
message: diagnostic,
|
||||
start_location: diagnostic.expect_ruff_start_location(),
|
||||
});
|
||||
}
|
||||
grouped_messages
|
||||
}
|
||||
|
||||
struct DisplayGroupedMessage<'a> {
|
||||
message: MessageWithLocation<'a>,
|
||||
show_fix_status: bool,
|
||||
unsafe_fixes: UnsafeFixes,
|
||||
show_source: bool,
|
||||
row_length: NonZeroUsize,
|
||||
column_length: NonZeroUsize,
|
||||
notebook_index: Option<&'a NotebookIndex>,
|
||||
@@ -152,51 +169,50 @@ impl Display for DisplayGroupedMessage<'_> {
|
||||
},
|
||||
)?;
|
||||
|
||||
if self.show_source {
|
||||
use std::fmt::Write;
|
||||
let mut padded = PadAdapter::new(f);
|
||||
writeln!(
|
||||
padded,
|
||||
"{}",
|
||||
MessageCodeFrame {
|
||||
message,
|
||||
notebook_index: self.notebook_index
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) struct RuleCodeAndBody<'a> {
|
||||
pub(crate) message: &'a Diagnostic,
|
||||
pub(crate) show_fix_status: bool,
|
||||
pub(crate) unsafe_fixes: UnsafeFixes,
|
||||
}
|
||||
|
||||
impl Display for RuleCodeAndBody<'_> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
if self.show_fix_status {
|
||||
if let Some(fix) = self.message.fix() {
|
||||
// Do not display an indicator for inapplicable fixes
|
||||
if fix.applies(self.unsafe_fixes.required_applicability()) {
|
||||
if let Some(code) = self.message.secondary_code() {
|
||||
write!(f, "{} ", code.red().bold())?;
|
||||
}
|
||||
return write!(
|
||||
f,
|
||||
"{fix}{body}",
|
||||
fix = format_args!("[{}] ", "*".cyan()),
|
||||
body = self.message.body(),
|
||||
);
|
||||
}
|
||||
)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Adapter that adds a ' ' at the start of every line without the need to copy the string.
|
||||
/// Inspired by Rust's `debug_struct()` internal implementation that also uses a `PadAdapter`.
|
||||
struct PadAdapter<'buf> {
|
||||
buf: &'buf mut (dyn std::fmt::Write + 'buf),
|
||||
on_newline: bool,
|
||||
}
|
||||
|
||||
impl<'buf> PadAdapter<'buf> {
|
||||
fn new(buf: &'buf mut (dyn std::fmt::Write + 'buf)) -> Self {
|
||||
Self {
|
||||
buf,
|
||||
on_newline: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Write for PadAdapter<'_> {
|
||||
fn write_str(&mut self, s: &str) -> std::fmt::Result {
|
||||
for s in s.split_inclusive('\n') {
|
||||
if self.on_newline {
|
||||
self.buf.write_str(" ")?;
|
||||
}
|
||||
|
||||
self.on_newline = s.ends_with('\n');
|
||||
self.buf.write_str(s)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
if let Some(code) = self.message.secondary_code() {
|
||||
write!(
|
||||
f,
|
||||
"{code} {body}",
|
||||
code = code.red().bold(),
|
||||
body = self.message.body(),
|
||||
)
|
||||
} else {
|
||||
write!(
|
||||
f,
|
||||
"{code}: {body}",
|
||||
code = self.message.id().as_str().red().bold(),
|
||||
body = self.message.body(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,19 +242,9 @@ mod tests {
|
||||
assert_snapshot!(content);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn show_source() {
|
||||
let mut emitter = GroupedEmitter::default().with_show_source(true);
|
||||
let content = capture_emitter_output(&mut emitter, &create_diagnostics());
|
||||
|
||||
assert_snapshot!(content);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fix_status() {
|
||||
let mut emitter = GroupedEmitter::default()
|
||||
.with_show_fix_status(true)
|
||||
.with_show_source(true);
|
||||
let mut emitter = GroupedEmitter::default().with_show_fix_status(true);
|
||||
let content = capture_emitter_output(&mut emitter, &create_diagnostics());
|
||||
|
||||
assert_snapshot!(content);
|
||||
@@ -248,7 +254,6 @@ mod tests {
|
||||
fn fix_status_unsafe() {
|
||||
let mut emitter = GroupedEmitter::default()
|
||||
.with_show_fix_status(true)
|
||||
.with_show_source(true)
|
||||
.with_unsafe_fixes(UnsafeFixes::Enabled);
|
||||
let content = capture_emitter_output(&mut emitter, &create_diagnostics());
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use std::collections::BTreeMap;
|
||||
use std::fmt::Display;
|
||||
use std::io::Write;
|
||||
use std::ops::Deref;
|
||||
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
@@ -15,7 +13,7 @@ pub use github::GithubEmitter;
|
||||
pub use gitlab::GitlabEmitter;
|
||||
pub use grouped::GroupedEmitter;
|
||||
use ruff_notebook::NotebookIndex;
|
||||
use ruff_source_file::{LineColumn, SourceFile};
|
||||
use ruff_source_file::SourceFile;
|
||||
use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
pub use sarif::SarifEmitter;
|
||||
pub use text::TextEmitter;
|
||||
@@ -134,35 +132,6 @@ impl FileResolver for EmitterContext<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
struct MessageWithLocation<'a> {
|
||||
message: &'a Diagnostic,
|
||||
start_location: LineColumn,
|
||||
}
|
||||
|
||||
impl Deref for MessageWithLocation<'_> {
|
||||
type Target = Diagnostic;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
self.message
|
||||
}
|
||||
}
|
||||
|
||||
fn group_diagnostics_by_filename(
|
||||
diagnostics: &[Diagnostic],
|
||||
) -> BTreeMap<String, Vec<MessageWithLocation<'_>>> {
|
||||
let mut grouped_messages = BTreeMap::default();
|
||||
for diagnostic in diagnostics {
|
||||
grouped_messages
|
||||
.entry(diagnostic.expect_ruff_filename())
|
||||
.or_insert_with(Vec::new)
|
||||
.push(MessageWithLocation {
|
||||
message: diagnostic,
|
||||
start_location: diagnostic.expect_ruff_start_location(),
|
||||
});
|
||||
}
|
||||
grouped_messages
|
||||
}
|
||||
|
||||
/// Display format for [`Diagnostic`]s.
|
||||
///
|
||||
/// The emitter serializes a slice of [`Diagnostic`]s and writes them to a [`Write`].
|
||||
|
||||
@@ -5,7 +5,7 @@ expression: redact_fingerprint(&content)
|
||||
[
|
||||
{
|
||||
"check_name": "F401",
|
||||
"description": "`os` imported but unused",
|
||||
"description": "F401: `os` imported but unused",
|
||||
"fingerprint": "<redacted>",
|
||||
"location": {
|
||||
"path": "fib.py",
|
||||
@@ -24,7 +24,7 @@ expression: redact_fingerprint(&content)
|
||||
},
|
||||
{
|
||||
"check_name": "F841",
|
||||
"description": "Local variable `x` is assigned to but never used",
|
||||
"description": "F841: Local variable `x` is assigned to but never used",
|
||||
"fingerprint": "<redacted>",
|
||||
"location": {
|
||||
"path": "fib.py",
|
||||
@@ -43,7 +43,7 @@ expression: redact_fingerprint(&content)
|
||||
},
|
||||
{
|
||||
"check_name": "F821",
|
||||
"description": "Undefined name `a`",
|
||||
"description": "F821: Undefined name `a`",
|
||||
"fingerprint": "<redacted>",
|
||||
"location": {
|
||||
"path": "undef.py",
|
||||
|
||||
@@ -4,8 +4,8 @@ expression: redact_fingerprint(&content)
|
||||
---
|
||||
[
|
||||
{
|
||||
"check_name": "syntax-error",
|
||||
"description": "Expected one or more symbol names after import",
|
||||
"check_name": "invalid-syntax",
|
||||
"description": "invalid-syntax: Expected one or more symbol names after import",
|
||||
"fingerprint": "<redacted>",
|
||||
"location": {
|
||||
"path": "syntax_errors.py",
|
||||
@@ -23,8 +23,8 @@ expression: redact_fingerprint(&content)
|
||||
"severity": "major"
|
||||
},
|
||||
{
|
||||
"check_name": "syntax-error",
|
||||
"description": "Expected ')', found newline",
|
||||
"check_name": "invalid-syntax",
|
||||
"description": "invalid-syntax: Expected ')', found newline",
|
||||
"fingerprint": "<redacted>",
|
||||
"location": {
|
||||
"path": "syntax_errors.py",
|
||||
|
||||
@@ -1,30 +1,10 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/message/grouped.rs
|
||||
expression: content
|
||||
snapshot_kind: text
|
||||
---
|
||||
fib.py:
|
||||
1:8 F401 `os` imported but unused
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
|
||||
6:5 F841 Local variable `x` is assigned to but never used
|
||||
|
|
||||
4 | def fibonacci(n):
|
||||
5 | """Compute the nth number in the Fibonacci sequence."""
|
||||
6 | x = 1
|
||||
| ^ F841
|
||||
7 | if n == 0:
|
||||
8 | return 0
|
||||
|
|
||||
= help: Remove assignment to unused variable `x`
|
||||
|
||||
|
||||
undef.py:
|
||||
1:4 F821 Undefined name `a`
|
||||
|
|
||||
1 | if a == 1: pass
|
||||
| ^ F821
|
||||
|
|
||||
|
||||
@@ -1,30 +1,10 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/message/grouped.rs
|
||||
expression: content
|
||||
snapshot_kind: text
|
||||
---
|
||||
fib.py:
|
||||
1:8 F401 [*] `os` imported but unused
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
|
||||
6:5 F841 [*] Local variable `x` is assigned to but never used
|
||||
|
|
||||
4 | def fibonacci(n):
|
||||
5 | """Compute the nth number in the Fibonacci sequence."""
|
||||
6 | x = 1
|
||||
| ^ F841
|
||||
7 | if n == 0:
|
||||
8 | return 0
|
||||
|
|
||||
= help: Remove assignment to unused variable `x`
|
||||
|
||||
|
||||
undef.py:
|
||||
1:4 F821 Undefined name `a`
|
||||
|
|
||||
1 | if a == 1: pass
|
||||
| ^ F821
|
||||
|
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/message/grouped.rs
|
||||
expression: content
|
||||
snapshot_kind: text
|
||||
---
|
||||
fib.py:
|
||||
1:8 F401 `os` imported but unused
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
|
||||
6:5 F841 Local variable `x` is assigned to but never used
|
||||
|
|
||||
4 | def fibonacci(n):
|
||||
5 | """Compute the nth number in the Fibonacci sequence."""
|
||||
6 | x = 1
|
||||
| ^ F841
|
||||
7 | if n == 0:
|
||||
8 | return 0
|
||||
|
|
||||
= help: Remove assignment to unused variable `x`
|
||||
|
||||
undef.py:
|
||||
1:4 F821 Undefined name `a`
|
||||
|
|
||||
1 | if a == 1: pass
|
||||
| ^ F821
|
||||
|
|
||||
@@ -1,28 +1,30 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/message/text.rs
|
||||
expression: content
|
||||
snapshot_kind: text
|
||||
---
|
||||
fib.py:1:8: F401 `os` imported but unused
|
||||
F401 `os` imported but unused
|
||||
--> fib.py:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
fib.py:6:5: F841 Local variable `x` is assigned to but never used
|
||||
F841 Local variable `x` is assigned to but never used
|
||||
--> fib.py:6:5
|
||||
|
|
||||
4 | def fibonacci(n):
|
||||
5 | """Compute the nth number in the Fibonacci sequence."""
|
||||
6 | x = 1
|
||||
| ^ F841
|
||||
| ^
|
||||
7 | if n == 0:
|
||||
8 | return 0
|
||||
|
|
||||
= help: Remove assignment to unused variable `x`
|
||||
help: Remove assignment to unused variable `x`
|
||||
|
||||
undef.py:1:4: F821 Undefined name `a`
|
||||
F821 Undefined name `a`
|
||||
--> undef.py:1:4
|
||||
|
|
||||
1 | if a == 1: pass
|
||||
| ^ F821
|
||||
| ^
|
||||
|
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/message/text.rs
|
||||
expression: content
|
||||
snapshot_kind: text
|
||||
---
|
||||
fib.py:1:8: F401 `os` imported but unused
|
||||
F401 `os` imported but unused
|
||||
--> fib.py:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
fib.py:6:5: F841 Local variable `x` is assigned to but never used
|
||||
F841 Local variable `x` is assigned to but never used
|
||||
--> fib.py:6:5
|
||||
|
|
||||
4 | def fibonacci(n):
|
||||
5 | """Compute the nth number in the Fibonacci sequence."""
|
||||
6 | x = 1
|
||||
| ^ F841
|
||||
| ^
|
||||
7 | if n == 0:
|
||||
8 | return 0
|
||||
|
|
||||
= help: Remove assignment to unused variable `x`
|
||||
help: Remove assignment to unused variable `x`
|
||||
|
||||
undef.py:1:4: F821 Undefined name `a`
|
||||
F821 Undefined name `a`
|
||||
--> undef.py:1:4
|
||||
|
|
||||
1 | if a == 1: pass
|
||||
| ^ F821
|
||||
| ^
|
||||
|
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/message/text.rs
|
||||
expression: content
|
||||
snapshot_kind: text
|
||||
---
|
||||
fib.py:1:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> fib.py:1:8
|
||||
|
|
||||
1 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
fib.py:6:5: F841 [*] Local variable `x` is assigned to but never used
|
||||
F841 [*] Local variable `x` is assigned to but never used
|
||||
--> fib.py:6:5
|
||||
|
|
||||
4 | def fibonacci(n):
|
||||
5 | """Compute the nth number in the Fibonacci sequence."""
|
||||
6 | x = 1
|
||||
| ^ F841
|
||||
| ^
|
||||
7 | if n == 0:
|
||||
8 | return 0
|
||||
|
|
||||
= help: Remove assignment to unused variable `x`
|
||||
help: Remove assignment to unused variable `x`
|
||||
|
||||
undef.py:1:4: F821 Undefined name `a`
|
||||
F821 Undefined name `a`
|
||||
--> undef.py:1:4
|
||||
|
|
||||
1 | if a == 1: pass
|
||||
| ^ F821
|
||||
| ^
|
||||
|
|
||||
|
||||
@@ -2,29 +2,32 @@
|
||||
source: crates/ruff_linter/src/message/text.rs
|
||||
expression: content
|
||||
---
|
||||
notebook.ipynb:cell 1:2:8: F401 [*] `os` imported but unused
|
||||
F401 [*] `os` imported but unused
|
||||
--> notebook.ipynb:cell 1:2:8
|
||||
|
|
||||
1 | # cell 1
|
||||
2 | import os
|
||||
| ^^ F401
|
||||
| ^^
|
||||
|
|
||||
= help: Remove unused import: `os`
|
||||
help: Remove unused import: `os`
|
||||
|
||||
notebook.ipynb:cell 2:2:8: F401 [*] `math` imported but unused
|
||||
F401 [*] `math` imported but unused
|
||||
--> notebook.ipynb:cell 2:2:8
|
||||
|
|
||||
1 | # cell 2
|
||||
2 | import math
|
||||
| ^^^^ F401
|
||||
| ^^^^
|
||||
3 |
|
||||
4 | print('hello world')
|
||||
|
|
||||
= help: Remove unused import: `math`
|
||||
help: Remove unused import: `math`
|
||||
|
||||
notebook.ipynb:cell 3:4:5: F841 [*] Local variable `x` is assigned to but never used
|
||||
F841 [*] Local variable `x` is assigned to but never used
|
||||
--> notebook.ipynb:cell 3:4:5
|
||||
|
|
||||
2 | def foo():
|
||||
3 | print()
|
||||
4 | x = 1
|
||||
| ^ F841
|
||||
| ^
|
||||
|
|
||||
= help: Remove assignment to unused variable `x`
|
||||
help: Remove assignment to unused variable `x`
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
source: crates/ruff_linter/src/message/text.rs
|
||||
expression: content
|
||||
---
|
||||
syntax_errors.py:1:15: invalid-syntax: Expected one or more symbol names after import
|
||||
invalid-syntax: Expected one or more symbol names after import
|
||||
--> syntax_errors.py:1:15
|
||||
|
|
||||
1 | from os import
|
||||
| ^
|
||||
2 |
|
||||
3 | if call(foo
|
||||
4 | def bar():
|
||||
|
|
||||
|
||||
syntax_errors.py:3:12: invalid-syntax: Expected ')', found newline
|
||||
invalid-syntax: Expected ')', found newline
|
||||
--> syntax_errors.py:3:12
|
||||
|
|
||||
1 | from os import
|
||||
2 |
|
||||
|
||||
@@ -1,41 +1,23 @@
|
||||
use std::borrow::Cow;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::io::Write;
|
||||
|
||||
use bitflags::bitflags;
|
||||
use colored::Colorize;
|
||||
use ruff_annotate_snippets::{Level, Renderer, Snippet};
|
||||
|
||||
use ruff_db::diagnostic::{
|
||||
Diagnostic, DiagnosticFormat, DisplayDiagnosticConfig, SecondaryCode, ceil_char_boundary,
|
||||
};
|
||||
use ruff_notebook::NotebookIndex;
|
||||
use ruff_source_file::OneIndexed;
|
||||
use ruff_text_size::{TextLen, TextRange, TextSize};
|
||||
use ruff_db::diagnostic::{Diagnostic, DiagnosticFormat, DisplayDiagnosticConfig};
|
||||
|
||||
use crate::message::diff::Diff;
|
||||
use crate::message::{Emitter, EmitterContext};
|
||||
use crate::settings::types::UnsafeFixes;
|
||||
|
||||
bitflags! {
|
||||
#[derive(Default)]
|
||||
struct EmitterFlags: u8 {
|
||||
/// Whether to show the diff of a fix, for diagnostics that have a fix.
|
||||
const SHOW_FIX_DIFF = 1 << 1;
|
||||
/// Whether to show the source code of a diagnostic.
|
||||
const SHOW_SOURCE = 1 << 2;
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TextEmitter {
|
||||
flags: EmitterFlags,
|
||||
/// Whether to show the diff of a fix, for diagnostics that have a fix.
|
||||
///
|
||||
/// Note that this is not currently exposed in the CLI (#7352) and is only used in tests.
|
||||
show_fix_diff: bool,
|
||||
config: DisplayDiagnosticConfig,
|
||||
}
|
||||
|
||||
impl Default for TextEmitter {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
flags: EmitterFlags::default(),
|
||||
show_fix_diff: false,
|
||||
config: DisplayDiagnosticConfig::default()
|
||||
.format(DiagnosticFormat::Concise)
|
||||
.hide_severity(true)
|
||||
@@ -53,13 +35,17 @@ impl TextEmitter {
|
||||
|
||||
#[must_use]
|
||||
pub fn with_show_fix_diff(mut self, show_fix_diff: bool) -> Self {
|
||||
self.flags.set(EmitterFlags::SHOW_FIX_DIFF, show_fix_diff);
|
||||
self.show_fix_diff = show_fix_diff;
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_show_source(mut self, show_source: bool) -> Self {
|
||||
self.flags.set(EmitterFlags::SHOW_SOURCE, show_source);
|
||||
self.config = self.config.format(if show_source {
|
||||
DiagnosticFormat::Full
|
||||
} else {
|
||||
DiagnosticFormat::Concise
|
||||
});
|
||||
self
|
||||
}
|
||||
|
||||
@@ -94,23 +80,7 @@ impl Emitter for TextEmitter {
|
||||
for message in diagnostics {
|
||||
write!(writer, "{}", message.display(context, &self.config))?;
|
||||
|
||||
let filename = message.expect_ruff_filename();
|
||||
let notebook_index = context.notebook_index(&filename);
|
||||
if self.flags.intersects(EmitterFlags::SHOW_SOURCE) {
|
||||
// The `0..0` range is used to highlight file-level diagnostics.
|
||||
if message.expect_range() != TextRange::default() {
|
||||
writeln!(
|
||||
writer,
|
||||
"{}",
|
||||
MessageCodeFrame {
|
||||
message,
|
||||
notebook_index
|
||||
}
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
if self.flags.intersects(EmitterFlags::SHOW_FIX_DIFF) {
|
||||
if self.show_fix_diff {
|
||||
if let Some(diff) = Diff::from_message(message) {
|
||||
writeln!(writer, "{diff}")?;
|
||||
}
|
||||
@@ -121,267 +91,6 @@ impl Emitter for TextEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) struct RuleCodeAndBody<'a> {
|
||||
pub(crate) message: &'a Diagnostic,
|
||||
pub(crate) show_fix_status: bool,
|
||||
pub(crate) unsafe_fixes: UnsafeFixes,
|
||||
}
|
||||
|
||||
impl Display for RuleCodeAndBody<'_> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
if self.show_fix_status {
|
||||
if let Some(fix) = self.message.fix() {
|
||||
// Do not display an indicator for inapplicable fixes
|
||||
if fix.applies(self.unsafe_fixes.required_applicability()) {
|
||||
if let Some(code) = self.message.secondary_code() {
|
||||
write!(f, "{} ", code.red().bold())?;
|
||||
}
|
||||
return write!(
|
||||
f,
|
||||
"{fix}{body}",
|
||||
fix = format_args!("[{}] ", "*".cyan()),
|
||||
body = self.message.body(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(code) = self.message.secondary_code() {
|
||||
write!(
|
||||
f,
|
||||
"{code} {body}",
|
||||
code = code.red().bold(),
|
||||
body = self.message.body(),
|
||||
)
|
||||
} else {
|
||||
write!(
|
||||
f,
|
||||
"{code}: {body}",
|
||||
code = self.message.id().as_str().red().bold(),
|
||||
body = self.message.body(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) struct MessageCodeFrame<'a> {
|
||||
pub(crate) message: &'a Diagnostic,
|
||||
pub(crate) notebook_index: Option<&'a NotebookIndex>,
|
||||
}
|
||||
|
||||
impl Display for MessageCodeFrame<'_> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
let suggestion = self.message.first_help_text();
|
||||
let footers = if let Some(suggestion) = suggestion {
|
||||
vec![Level::Help.title(suggestion)]
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
|
||||
let source_file = self.message.expect_ruff_source_file();
|
||||
let source_code = source_file.to_source_code();
|
||||
|
||||
let content_start_index = source_code.line_index(self.message.expect_range().start());
|
||||
let mut start_index = content_start_index.saturating_sub(2);
|
||||
|
||||
// If we're working with a Jupyter Notebook, skip the lines which are
|
||||
// outside of the cell containing the diagnostic.
|
||||
if let Some(index) = self.notebook_index {
|
||||
let content_start_cell = index.cell(content_start_index).unwrap_or(OneIndexed::MIN);
|
||||
while start_index < content_start_index {
|
||||
if index.cell(start_index).unwrap_or(OneIndexed::MIN) == content_start_cell {
|
||||
break;
|
||||
}
|
||||
start_index = start_index.saturating_add(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Trim leading empty lines.
|
||||
while start_index < content_start_index {
|
||||
if !source_code.line_text(start_index).trim().is_empty() {
|
||||
break;
|
||||
}
|
||||
start_index = start_index.saturating_add(1);
|
||||
}
|
||||
|
||||
let content_end_index = source_code.line_index(self.message.expect_range().end());
|
||||
let mut end_index = content_end_index
|
||||
.saturating_add(2)
|
||||
.min(OneIndexed::from_zero_indexed(source_code.line_count()));
|
||||
|
||||
// If we're working with a Jupyter Notebook, skip the lines which are
|
||||
// outside of the cell containing the diagnostic.
|
||||
if let Some(index) = self.notebook_index {
|
||||
let content_end_cell = index.cell(content_end_index).unwrap_or(OneIndexed::MIN);
|
||||
while end_index > content_end_index {
|
||||
if index.cell(end_index).unwrap_or(OneIndexed::MIN) == content_end_cell {
|
||||
break;
|
||||
}
|
||||
end_index = end_index.saturating_sub(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Trim trailing empty lines.
|
||||
while end_index > content_end_index {
|
||||
if !source_code.line_text(end_index).trim().is_empty() {
|
||||
break;
|
||||
}
|
||||
|
||||
end_index = end_index.saturating_sub(1);
|
||||
}
|
||||
|
||||
let start_offset = source_code.line_start(start_index);
|
||||
let end_offset = source_code.line_end(end_index);
|
||||
|
||||
let source = replace_unprintable(
|
||||
source_code.slice(TextRange::new(start_offset, end_offset)),
|
||||
self.message.expect_range() - start_offset,
|
||||
)
|
||||
.fix_up_empty_spans_after_line_terminator();
|
||||
|
||||
let label = self
|
||||
.message
|
||||
.secondary_code()
|
||||
.map(SecondaryCode::as_str)
|
||||
.unwrap_or_default();
|
||||
|
||||
let line_start = self.notebook_index.map_or_else(
|
||||
|| start_index.get(),
|
||||
|notebook_index| {
|
||||
notebook_index
|
||||
.cell_row(start_index)
|
||||
.unwrap_or(OneIndexed::MIN)
|
||||
.get()
|
||||
},
|
||||
);
|
||||
|
||||
let span = usize::from(source.annotation_range.start())
|
||||
..usize::from(source.annotation_range.end());
|
||||
let annotation = Level::Error.span(span).label(label);
|
||||
let snippet = Snippet::source(&source.text)
|
||||
.line_start(line_start)
|
||||
.annotation(annotation)
|
||||
.fold(false);
|
||||
let message = Level::None.title("").snippet(snippet).footers(footers);
|
||||
|
||||
let renderer = if !cfg!(test) && colored::control::SHOULD_COLORIZE.should_colorize() {
|
||||
Renderer::styled()
|
||||
} else {
|
||||
Renderer::plain()
|
||||
}
|
||||
.cut_indicator("…");
|
||||
let rendered = renderer.render(message);
|
||||
writeln!(f, "{rendered}")
|
||||
}
|
||||
}
|
||||
|
||||
/// Given some source code and an annotation range, this routine replaces
|
||||
/// unprintable characters with printable representations of them.
|
||||
///
|
||||
/// The source code returned has an annotation that is updated to reflect
|
||||
/// changes made to the source code (if any).
|
||||
///
|
||||
/// We don't need to normalize whitespace, such as converting tabs to spaces,
|
||||
/// because `annotate-snippets` handles that internally. Similarly, it's safe to
|
||||
/// modify the annotation ranges by inserting 3-byte Unicode replacements
|
||||
/// because `annotate-snippets` will account for their actual width when
|
||||
/// rendering and displaying the column to the user.
|
||||
fn replace_unprintable(source: &str, annotation_range: TextRange) -> SourceCode<'_> {
|
||||
let mut result = String::new();
|
||||
let mut last_end = 0;
|
||||
let mut range = annotation_range;
|
||||
|
||||
// Updates the range given by the caller whenever a single byte (at
|
||||
// `index` in `source`) is replaced with `len` bytes.
|
||||
//
|
||||
// When the index occurs before the start of the range, the range is
|
||||
// offset by `len`. When the range occurs after or at the start but before
|
||||
// the end, then the end of the range only is offset by `len`.
|
||||
let mut update_range = |index, len| {
|
||||
if index < usize::from(annotation_range.start()) {
|
||||
range += TextSize::new(len - 1);
|
||||
} else if index < usize::from(annotation_range.end()) {
|
||||
range = range.add_end(TextSize::new(len - 1));
|
||||
}
|
||||
};
|
||||
|
||||
// If `c` is an unprintable character, then this returns a printable
|
||||
// representation of it (using a fancier Unicode codepoint).
|
||||
let unprintable_replacement = |c: char| -> Option<char> {
|
||||
match c {
|
||||
'\x07' => Some('␇'),
|
||||
'\x08' => Some('␈'),
|
||||
'\x1b' => Some('␛'),
|
||||
'\x7f' => Some('␡'),
|
||||
_ => None,
|
||||
}
|
||||
};
|
||||
|
||||
for (index, c) in source.char_indices() {
|
||||
if let Some(printable) = unprintable_replacement(c) {
|
||||
result.push_str(&source[last_end..index]);
|
||||
result.push(printable);
|
||||
last_end = index + 1;
|
||||
|
||||
let len = printable.text_len().to_u32();
|
||||
update_range(index, len);
|
||||
}
|
||||
}
|
||||
|
||||
// No tabs or unprintable chars
|
||||
if result.is_empty() {
|
||||
SourceCode {
|
||||
annotation_range,
|
||||
text: Cow::Borrowed(source),
|
||||
}
|
||||
} else {
|
||||
result.push_str(&source[last_end..]);
|
||||
SourceCode {
|
||||
annotation_range: range,
|
||||
text: Cow::Owned(result),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SourceCode<'a> {
|
||||
text: Cow<'a, str>,
|
||||
annotation_range: TextRange,
|
||||
}
|
||||
|
||||
impl<'a> SourceCode<'a> {
|
||||
/// This attempts to "fix up" the span on `SourceCode` in the case where
|
||||
/// it's an empty span immediately following a line terminator.
|
||||
///
|
||||
/// At present, `annotate-snippets` (both upstream and our vendored copy)
|
||||
/// will render annotations of such spans to point to the space immediately
|
||||
/// following the previous line. But ideally, this should point to the space
|
||||
/// immediately preceding the next line.
|
||||
///
|
||||
/// After attempting to fix `annotate-snippets` and giving up after a couple
|
||||
/// hours, this routine takes a different tact: it adjusts the span to be
|
||||
/// non-empty and it will cover the first codepoint of the following line.
|
||||
/// This forces `annotate-snippets` to point to the right place.
|
||||
///
|
||||
/// See also: <https://github.com/astral-sh/ruff/issues/15509>
|
||||
fn fix_up_empty_spans_after_line_terminator(self) -> SourceCode<'a> {
|
||||
if !self.annotation_range.is_empty()
|
||||
|| self.annotation_range.start() == TextSize::from(0)
|
||||
|| self.annotation_range.start() >= self.text.text_len()
|
||||
{
|
||||
return self;
|
||||
}
|
||||
if self.text.as_bytes()[self.annotation_range.start().to_usize() - 1] != b'\n' {
|
||||
return self;
|
||||
}
|
||||
let start = self.annotation_range.start();
|
||||
let end = ceil_char_boundary(&self.text, start + TextSize::from(1));
|
||||
SourceCode {
|
||||
annotation_range: TextRange::new(start, end),
|
||||
..self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use insta::assert_snapshot;
|
||||
|
||||
@@ -710,6 +710,10 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
|
||||
},
|
||||
|
||||
// airflow.secrets
|
||||
["airflow", "secrets", "cache", "SecretCache"] => Replacement::AutoImport {
|
||||
module: "airflow.sdk",
|
||||
name: "SecretCache",
|
||||
},
|
||||
["airflow", "secrets", "local_filesystem", "load_connections"] => Replacement::AutoImport {
|
||||
module: "airflow.secrets.local_filesystem",
|
||||
name: "load_connections_dict",
|
||||
|
||||
@@ -1,29 +1,32 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR001.py:11:1: AIR001 Task variable name should match the `task_id`: "my_task"
|
||||
AIR001 Task variable name should match the `task_id`: "my_task"
|
||||
--> AIR001.py:11:1
|
||||
|
|
||||
10 | my_task = PythonOperator(task_id="my_task", callable=my_callable)
|
||||
11 | incorrect_name = PythonOperator(task_id="my_task") # AIR001
|
||||
| ^^^^^^^^^^^^^^ AIR001
|
||||
| ^^^^^^^^^^^^^^
|
||||
12 |
|
||||
13 | my_task = AirbyteTriggerSyncOperator(task_id="my_task", callable=my_callable)
|
||||
|
|
||||
|
||||
AIR001.py:14:1: AIR001 Task variable name should match the `task_id`: "my_task"
|
||||
AIR001 Task variable name should match the `task_id`: "my_task"
|
||||
--> AIR001.py:14:1
|
||||
|
|
||||
13 | my_task = AirbyteTriggerSyncOperator(task_id="my_task", callable=my_callable)
|
||||
14 | incorrect_name = AirbyteTriggerSyncOperator(task_id="my_task") # AIR001
|
||||
| ^^^^^^^^^^^^^^ AIR001
|
||||
| ^^^^^^^^^^^^^^
|
||||
15 |
|
||||
16 | my_task = AppflowFlowRunOperator(task_id="my_task", callable=my_callable)
|
||||
|
|
||||
|
||||
AIR001.py:17:1: AIR001 Task variable name should match the `task_id`: "my_task"
|
||||
AIR001 Task variable name should match the `task_id`: "my_task"
|
||||
--> AIR001.py:17:1
|
||||
|
|
||||
16 | my_task = AppflowFlowRunOperator(task_id="my_task", callable=my_callable)
|
||||
17 | incorrect_name = AppflowFlowRunOperator(task_id="my_task") # AIR001
|
||||
| ^^^^^^^^^^^^^^ AIR001
|
||||
| ^^^^^^^^^^^^^^
|
||||
18 |
|
||||
19 | # Consider only from the `airflow.operators` (or providers operators) module
|
||||
|
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR002.py:4:1: AIR002 DAG should have an explicit `schedule` argument
|
||||
AIR002 DAG should have an explicit `schedule` argument
|
||||
--> AIR002.py:4:1
|
||||
|
|
||||
2 | from airflow.timetables.simple import NullTimetable
|
||||
3 |
|
||||
4 | DAG(dag_id="class_default_schedule")
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
5 |
|
||||
6 | DAG(dag_id="class_schedule", schedule="@hourly")
|
||||
|
|
||||
|
||||
AIR002.py:13:2: AIR002 DAG should have an explicit `schedule` argument
|
||||
AIR002 DAG should have an explicit `schedule` argument
|
||||
--> AIR002.py:13:2
|
||||
|
|
||||
13 | @dag()
|
||||
| ^^^^^ AIR002
|
||||
| ^^^^^
|
||||
14 | def decorator_default_schedule():
|
||||
15 | pass
|
||||
|
|
||||
|
||||
@@ -1,46 +1,50 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR301_airflow_plugin.py:7:5: AIR301 `operators` is removed in Airflow 3.0
|
||||
AIR301 `operators` is removed in Airflow 3.0
|
||||
--> AIR301_airflow_plugin.py:7:5
|
||||
|
|
||||
5 | name = "test_plugin"
|
||||
6 | # --- Invalid extensions start
|
||||
7 | operators = [PluginOperator]
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
8 | sensors = [PluginSensorOperator]
|
||||
9 | hooks = [PluginHook]
|
||||
|
|
||||
= help: This extension should just be imported as a regular python module.
|
||||
help: This extension should just be imported as a regular python module.
|
||||
|
||||
AIR301_airflow_plugin.py:8:5: AIR301 `sensors` is removed in Airflow 3.0
|
||||
AIR301 `sensors` is removed in Airflow 3.0
|
||||
--> AIR301_airflow_plugin.py:8:5
|
||||
|
|
||||
6 | # --- Invalid extensions start
|
||||
7 | operators = [PluginOperator]
|
||||
8 | sensors = [PluginSensorOperator]
|
||||
| ^^^^^^^ AIR301
|
||||
| ^^^^^^^
|
||||
9 | hooks = [PluginHook]
|
||||
10 | executors = [PluginExecutor]
|
||||
|
|
||||
= help: This extension should just be imported as a regular python module.
|
||||
help: This extension should just be imported as a regular python module.
|
||||
|
||||
AIR301_airflow_plugin.py:9:5: AIR301 `hooks` is removed in Airflow 3.0
|
||||
AIR301 `hooks` is removed in Airflow 3.0
|
||||
--> AIR301_airflow_plugin.py:9:5
|
||||
|
|
||||
7 | operators = [PluginOperator]
|
||||
8 | sensors = [PluginSensorOperator]
|
||||
9 | hooks = [PluginHook]
|
||||
| ^^^^^ AIR301
|
||||
| ^^^^^
|
||||
10 | executors = [PluginExecutor]
|
||||
11 | # --- Invalid extensions end
|
||||
|
|
||||
= help: This extension should just be imported as a regular python module.
|
||||
help: This extension should just be imported as a regular python module.
|
||||
|
||||
AIR301_airflow_plugin.py:10:5: AIR301 `executors` is removed in Airflow 3.0
|
||||
AIR301 `executors` is removed in Airflow 3.0
|
||||
--> AIR301_airflow_plugin.py:10:5
|
||||
|
|
||||
8 | sensors = [PluginSensorOperator]
|
||||
9 | hooks = [PluginHook]
|
||||
10 | executors = [PluginExecutor]
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
11 | # --- Invalid extensions end
|
||||
12 | macros = [plugin_macro]
|
||||
|
|
||||
= help: This extension should just be imported as a regular python module.
|
||||
help: This extension should just be imported as a regular python module.
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR301_args.py:21:39: AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:21:39
|
||||
|
|
||||
19 | DAG(dag_id="class_schedule", schedule="@hourly")
|
||||
20 |
|
||||
21 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
22 |
|
||||
23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||
|
|
||||
= help: Use `schedule` instead
|
||||
help: Use `schedule` instead
|
||||
|
||||
ℹ Safe fix
|
||||
18 18 |
|
||||
@@ -22,14 +23,15 @@ AIR301_args.py:21:39: AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
23 23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||
24 24 |
|
||||
|
||||
AIR301_args.py:23:31: AIR301 [*] `timetable` is removed in Airflow 3.0
|
||||
AIR301 [*] `timetable` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:23:31
|
||||
|
|
||||
21 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
|
||||
22 |
|
||||
23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: Use `schedule` instead
|
||||
help: Use `schedule` instead
|
||||
|
||||
ℹ Safe fix
|
||||
20 20 |
|
||||
@@ -41,14 +43,15 @@ AIR301_args.py:23:31: AIR301 [*] `timetable` is removed in Airflow 3.0
|
||||
25 25 |
|
||||
26 26 | DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||
|
||||
AIR301_args.py:26:31: AIR301 [*] `fail_stop` is removed in Airflow 3.0
|
||||
AIR301 [*] `fail_stop` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:26:31
|
||||
|
|
||||
26 | DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
27 |
|
||||
28 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||
|
|
||||
= help: Use `fail_fast` instead
|
||||
help: Use `fail_fast` instead
|
||||
|
||||
ℹ Safe fix
|
||||
23 23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
||||
@@ -60,34 +63,37 @@ AIR301_args.py:26:31: AIR301 [*] `fail_stop` is removed in Airflow 3.0
|
||||
28 28 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||
29 29 |
|
||||
|
||||
AIR301_args.py:28:34: AIR301 `default_view` is removed in Airflow 3.0
|
||||
AIR301 `default_view` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:28:34
|
||||
|
|
||||
26 | DAG(dag_id="class_fail_stop", fail_stop=True)
|
||||
27 |
|
||||
28 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
29 |
|
||||
30 | DAG(dag_id="class_orientation", orientation="BT")
|
||||
|
|
||||
|
||||
AIR301_args.py:30:33: AIR301 `orientation` is removed in Airflow 3.0
|
||||
AIR301 `orientation` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:30:33
|
||||
|
|
||||
28 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
||||
29 |
|
||||
30 | DAG(dag_id="class_orientation", orientation="BT")
|
||||
| ^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^
|
||||
31 |
|
||||
32 | allow_future_exec_dates_dag = DAG(dag_id="class_allow_future_exec_dates")
|
||||
|
|
||||
|
||||
AIR301_args.py:41:6: AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:41:6
|
||||
|
|
||||
41 | @dag(schedule_interval="0 * * * *")
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
42 | def decorator_schedule_interval():
|
||||
43 | pass
|
||||
|
|
||||
= help: Use `schedule` instead
|
||||
help: Use `schedule` instead
|
||||
|
||||
ℹ Safe fix
|
||||
38 38 | pass
|
||||
@@ -99,14 +105,15 @@ AIR301_args.py:41:6: AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
43 43 | pass
|
||||
44 44 |
|
||||
|
||||
AIR301_args.py:46:6: AIR301 [*] `timetable` is removed in Airflow 3.0
|
||||
AIR301 [*] `timetable` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:46:6
|
||||
|
|
||||
46 | @dag(timetable=NullTimetable())
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
47 | def decorator_timetable():
|
||||
48 | pass
|
||||
|
|
||||
= help: Use `schedule` instead
|
||||
help: Use `schedule` instead
|
||||
|
||||
ℹ Safe fix
|
||||
43 43 | pass
|
||||
@@ -118,16 +125,17 @@ AIR301_args.py:46:6: AIR301 [*] `timetable` is removed in Airflow 3.0
|
||||
48 48 | pass
|
||||
49 49 |
|
||||
|
||||
AIR301_args.py:54:62: AIR301 [*] `execution_date` is removed in Airflow 3.0
|
||||
AIR301 [*] `execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:54:62
|
||||
|
|
||||
52 | def decorator_deprecated_operator_args():
|
||||
53 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
|
||||
54 | task_id="trigger_dagrun_op1", trigger_dag_id="test", execution_date="2024-12-04"
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
55 | )
|
||||
56 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
||||
|
|
||||
= help: Use `logical_date` instead
|
||||
help: Use `logical_date` instead
|
||||
|
||||
ℹ Safe fix
|
||||
51 51 | @dag()
|
||||
@@ -139,15 +147,16 @@ AIR301_args.py:54:62: AIR301 [*] `execution_date` is removed in Airflow 3.0
|
||||
56 56 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
||||
57 57 | task_id="trigger_dagrun_op2", trigger_dag_id="test", execution_date="2024-12-04"
|
||||
|
||||
AIR301_args.py:57:62: AIR301 [*] `execution_date` is removed in Airflow 3.0
|
||||
AIR301 [*] `execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:57:62
|
||||
|
|
||||
55 | )
|
||||
56 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
||||
57 | task_id="trigger_dagrun_op2", trigger_dag_id="test", execution_date="2024-12-04"
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
58 | )
|
||||
|
|
||||
= help: Use `logical_date` instead
|
||||
help: Use `logical_date` instead
|
||||
|
||||
ℹ Safe fix
|
||||
54 54 | task_id="trigger_dagrun_op1", trigger_dag_id="test", execution_date="2024-12-04"
|
||||
@@ -159,15 +168,16 @@ AIR301_args.py:57:62: AIR301 [*] `execution_date` is removed in Airflow 3.0
|
||||
59 59 |
|
||||
60 60 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||
|
||||
AIR301_args.py:61:33: AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||
AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:61:33
|
||||
|
|
||||
60 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||
61 | task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
62 | )
|
||||
63 | branch_dt_op2 = BranchDateTimeOperator(
|
||||
|
|
||||
= help: Use `use_task_logical_date` instead
|
||||
help: Use `use_task_logical_date` instead
|
||||
|
||||
ℹ Safe fix
|
||||
58 58 | )
|
||||
@@ -179,15 +189,16 @@ AIR301_args.py:61:33: AIR301 [*] `use_task_execution_day` is removed in Airflow
|
||||
63 63 | branch_dt_op2 = BranchDateTimeOperator(
|
||||
64 64 | task_id="branch_dt_op2",
|
||||
|
||||
AIR301_args.py:61:62: AIR301 [*] `task_concurrency` is removed in Airflow 3.0
|
||||
AIR301 [*] `task_concurrency` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:61:62
|
||||
|
|
||||
60 | branch_dt_op = datetime.BranchDateTimeOperator(
|
||||
61 | task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
62 | )
|
||||
63 | branch_dt_op2 = BranchDateTimeOperator(
|
||||
|
|
||||
= help: Use `max_active_tis_per_dag` instead
|
||||
help: Use `max_active_tis_per_dag` instead
|
||||
|
||||
ℹ Safe fix
|
||||
58 58 | )
|
||||
@@ -199,16 +210,17 @@ AIR301_args.py:61:62: AIR301 [*] `task_concurrency` is removed in Airflow 3.0
|
||||
63 63 | branch_dt_op2 = BranchDateTimeOperator(
|
||||
64 64 | task_id="branch_dt_op2",
|
||||
|
||||
AIR301_args.py:65:9: AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||
AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:65:9
|
||||
|
|
||||
63 | branch_dt_op2 = BranchDateTimeOperator(
|
||||
64 | task_id="branch_dt_op2",
|
||||
65 | use_task_execution_day=True,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
66 | sla=timedelta(seconds=10),
|
||||
67 | )
|
||||
|
|
||||
= help: Use `use_task_logical_date` instead
|
||||
help: Use `use_task_logical_date` instead
|
||||
|
||||
ℹ Safe fix
|
||||
62 62 | )
|
||||
@@ -220,15 +232,16 @@ AIR301_args.py:65:9: AIR301 [*] `use_task_execution_day` is removed in Airflow 3
|
||||
67 67 | )
|
||||
68 68 |
|
||||
|
||||
AIR301_args.py:92:9: AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||
AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:92:9
|
||||
|
|
||||
90 | follow_task_ids_if_true=None,
|
||||
91 | week_day=1,
|
||||
92 | use_task_execution_day=True,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
93 | )
|
||||
|
|
||||
= help: Use `use_task_logical_date` instead
|
||||
help: Use `use_task_logical_date` instead
|
||||
|
||||
ℹ Safe fix
|
||||
89 89 | follow_task_ids_if_false=None,
|
||||
@@ -240,49 +253,54 @@ AIR301_args.py:92:9: AIR301 [*] `use_task_execution_day` is removed in Airflow 3
|
||||
94 94 |
|
||||
95 95 | trigger_dagrun_op >> trigger_dagrun_op2
|
||||
|
||||
AIR301_args.py:102:15: AIR301 `filename_template` is removed in Airflow 3.0
|
||||
AIR301 `filename_template` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:102:15
|
||||
|
|
||||
101 | # deprecated filename_template argument in FileTaskHandler
|
||||
102 | S3TaskHandler(filename_template="/tmp/test")
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
103 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||
104 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||
|
|
||||
|
||||
AIR301_args.py:103:17: AIR301 `filename_template` is removed in Airflow 3.0
|
||||
AIR301 `filename_template` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:103:17
|
||||
|
|
||||
101 | # deprecated filename_template argument in FileTaskHandler
|
||||
102 | S3TaskHandler(filename_template="/tmp/test")
|
||||
103 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
104 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||
105 | GCSTaskHandler(filename_template="/tmp/test")
|
||||
|
|
||||
|
||||
AIR301_args.py:104:26: AIR301 `filename_template` is removed in Airflow 3.0
|
||||
AIR301 `filename_template` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:104:26
|
||||
|
|
||||
102 | S3TaskHandler(filename_template="/tmp/test")
|
||||
103 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||
104 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
105 | GCSTaskHandler(filename_template="/tmp/test")
|
||||
|
|
||||
|
||||
AIR301_args.py:105:16: AIR301 `filename_template` is removed in Airflow 3.0
|
||||
AIR301 `filename_template` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:105:16
|
||||
|
|
||||
103 | HdfsTaskHandler(filename_template="/tmp/test")
|
||||
104 | ElasticsearchTaskHandler(filename_template="/tmp/test")
|
||||
105 | GCSTaskHandler(filename_template="/tmp/test")
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
106 |
|
||||
107 | FabAuthManager(None)
|
||||
|
|
||||
|
||||
AIR301_args.py:107:15: AIR301 `appbuilder` is removed in Airflow 3.0
|
||||
AIR301 `appbuilder` is removed in Airflow 3.0
|
||||
--> AIR301_args.py:107:15
|
||||
|
|
||||
105 | GCSTaskHandler(filename_template="/tmp/test")
|
||||
106 |
|
||||
107 | FabAuthManager(None)
|
||||
| ^^^^^^ AIR301
|
||||
| ^^^^^^
|
||||
|
|
||||
= help: The constructor takes no parameter now
|
||||
help: The constructor takes no parameter now
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR301_class_attribute.py:25:19: AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:25:19
|
||||
|
|
||||
23 | # airflow.Dataset
|
||||
24 | dataset_from_root = DatasetFromRoot()
|
||||
25 | dataset_from_root.iter_datasets()
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
26 | dataset_from_root.iter_dataset_aliases()
|
||||
|
|
||||
= help: Use `iter_assets` instead
|
||||
help: Use `iter_assets` instead
|
||||
|
||||
ℹ Safe fix
|
||||
22 22 |
|
||||
@@ -21,16 +22,17 @@ AIR301_class_attribute.py:25:19: AIR301 [*] `iter_datasets` is removed in Airflo
|
||||
27 27 |
|
||||
28 28 | # airflow.datasets
|
||||
|
||||
AIR301_class_attribute.py:26:19: AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:26:19
|
||||
|
|
||||
24 | dataset_from_root = DatasetFromRoot()
|
||||
25 | dataset_from_root.iter_datasets()
|
||||
26 | dataset_from_root.iter_dataset_aliases()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
27 |
|
||||
28 | # airflow.datasets
|
||||
|
|
||||
= help: Use `iter_asset_aliases` instead
|
||||
help: Use `iter_asset_aliases` instead
|
||||
|
||||
ℹ Safe fix
|
||||
23 23 | # airflow.Dataset
|
||||
@@ -42,15 +44,16 @@ AIR301_class_attribute.py:26:19: AIR301 [*] `iter_dataset_aliases` is removed in
|
||||
28 28 | # airflow.datasets
|
||||
29 29 | dataset_to_test_method_call = Dataset()
|
||||
|
||||
AIR301_class_attribute.py:30:29: AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:30:29
|
||||
|
|
||||
28 | # airflow.datasets
|
||||
29 | dataset_to_test_method_call = Dataset()
|
||||
30 | dataset_to_test_method_call.iter_datasets()
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
31 | dataset_to_test_method_call.iter_dataset_aliases()
|
||||
|
|
||||
= help: Use `iter_assets` instead
|
||||
help: Use `iter_assets` instead
|
||||
|
||||
ℹ Safe fix
|
||||
27 27 |
|
||||
@@ -62,16 +65,17 @@ AIR301_class_attribute.py:30:29: AIR301 [*] `iter_datasets` is removed in Airflo
|
||||
32 32 |
|
||||
33 33 | alias_to_test_method_call = DatasetAlias()
|
||||
|
||||
AIR301_class_attribute.py:31:29: AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:31:29
|
||||
|
|
||||
29 | dataset_to_test_method_call = Dataset()
|
||||
30 | dataset_to_test_method_call.iter_datasets()
|
||||
31 | dataset_to_test_method_call.iter_dataset_aliases()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
32 |
|
||||
33 | alias_to_test_method_call = DatasetAlias()
|
||||
|
|
||||
= help: Use `iter_asset_aliases` instead
|
||||
help: Use `iter_asset_aliases` instead
|
||||
|
||||
ℹ Safe fix
|
||||
28 28 | # airflow.datasets
|
||||
@@ -83,14 +87,15 @@ AIR301_class_attribute.py:31:29: AIR301 [*] `iter_dataset_aliases` is removed in
|
||||
33 33 | alias_to_test_method_call = DatasetAlias()
|
||||
34 34 | alias_to_test_method_call.iter_datasets()
|
||||
|
||||
AIR301_class_attribute.py:34:27: AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:34:27
|
||||
|
|
||||
33 | alias_to_test_method_call = DatasetAlias()
|
||||
34 | alias_to_test_method_call.iter_datasets()
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
35 | alias_to_test_method_call.iter_dataset_aliases()
|
||||
|
|
||||
= help: Use `iter_assets` instead
|
||||
help: Use `iter_assets` instead
|
||||
|
||||
ℹ Safe fix
|
||||
31 31 | dataset_to_test_method_call.iter_dataset_aliases()
|
||||
@@ -102,16 +107,17 @@ AIR301_class_attribute.py:34:27: AIR301 [*] `iter_datasets` is removed in Airflo
|
||||
36 36 |
|
||||
37 37 | any_to_test_method_call = DatasetAny()
|
||||
|
||||
AIR301_class_attribute.py:35:27: AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:35:27
|
||||
|
|
||||
33 | alias_to_test_method_call = DatasetAlias()
|
||||
34 | alias_to_test_method_call.iter_datasets()
|
||||
35 | alias_to_test_method_call.iter_dataset_aliases()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
36 |
|
||||
37 | any_to_test_method_call = DatasetAny()
|
||||
|
|
||||
= help: Use `iter_asset_aliases` instead
|
||||
help: Use `iter_asset_aliases` instead
|
||||
|
||||
ℹ Safe fix
|
||||
32 32 |
|
||||
@@ -123,14 +129,15 @@ AIR301_class_attribute.py:35:27: AIR301 [*] `iter_dataset_aliases` is removed in
|
||||
37 37 | any_to_test_method_call = DatasetAny()
|
||||
38 38 | any_to_test_method_call.iter_datasets()
|
||||
|
||||
AIR301_class_attribute.py:38:25: AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_datasets` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:38:25
|
||||
|
|
||||
37 | any_to_test_method_call = DatasetAny()
|
||||
38 | any_to_test_method_call.iter_datasets()
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
39 | any_to_test_method_call.iter_dataset_aliases()
|
||||
|
|
||||
= help: Use `iter_assets` instead
|
||||
help: Use `iter_assets` instead
|
||||
|
||||
ℹ Safe fix
|
||||
35 35 | alias_to_test_method_call.iter_dataset_aliases()
|
||||
@@ -142,16 +149,17 @@ AIR301_class_attribute.py:38:25: AIR301 [*] `iter_datasets` is removed in Airflo
|
||||
40 40 |
|
||||
41 41 | # airflow.datasets.manager
|
||||
|
||||
AIR301_class_attribute.py:39:25: AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:39:25
|
||||
|
|
||||
37 | any_to_test_method_call = DatasetAny()
|
||||
38 | any_to_test_method_call.iter_datasets()
|
||||
39 | any_to_test_method_call.iter_dataset_aliases()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
40 |
|
||||
41 | # airflow.datasets.manager
|
||||
|
|
||||
= help: Use `iter_asset_aliases` instead
|
||||
help: Use `iter_asset_aliases` instead
|
||||
|
||||
ℹ Safe fix
|
||||
36 36 |
|
||||
@@ -163,15 +171,16 @@ AIR301_class_attribute.py:39:25: AIR301 [*] `iter_dataset_aliases` is removed in
|
||||
41 41 | # airflow.datasets.manager
|
||||
42 42 | dm = DatasetManager()
|
||||
|
||||
AIR301_class_attribute.py:42:6: AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:42:6
|
||||
|
|
||||
41 | # airflow.datasets.manager
|
||||
42 | dm = DatasetManager()
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
43 | dm.register_dataset_change()
|
||||
44 | dm.create_datasets()
|
||||
|
|
||||
= help: Use `AssetManager` from `airflow.assets.manager` instead.
|
||||
help: Use `AssetManager` from `airflow.assets.manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
19 19 | from airflow.providers_manager import ProvidersManager
|
||||
@@ -191,16 +200,17 @@ AIR301_class_attribute.py:42:6: AIR301 [*] `airflow.datasets.manager.DatasetMana
|
||||
44 45 | dm.create_datasets()
|
||||
45 46 | dm.notify_dataset_created()
|
||||
|
||||
AIR301_class_attribute.py:43:4: AIR301 [*] `register_dataset_change` is removed in Airflow 3.0
|
||||
AIR301 [*] `register_dataset_change` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:43:4
|
||||
|
|
||||
41 | # airflow.datasets.manager
|
||||
42 | dm = DatasetManager()
|
||||
43 | dm.register_dataset_change()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
44 | dm.create_datasets()
|
||||
45 | dm.notify_dataset_created()
|
||||
|
|
||||
= help: Use `register_asset_change` instead
|
||||
help: Use `register_asset_change` instead
|
||||
|
||||
ℹ Safe fix
|
||||
40 40 |
|
||||
@@ -212,16 +222,17 @@ AIR301_class_attribute.py:43:4: AIR301 [*] `register_dataset_change` is removed
|
||||
45 45 | dm.notify_dataset_created()
|
||||
46 46 | dm.notify_dataset_changed()
|
||||
|
||||
AIR301_class_attribute.py:44:4: AIR301 [*] `create_datasets` is removed in Airflow 3.0
|
||||
AIR301 [*] `create_datasets` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:44:4
|
||||
|
|
||||
42 | dm = DatasetManager()
|
||||
43 | dm.register_dataset_change()
|
||||
44 | dm.create_datasets()
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^
|
||||
45 | dm.notify_dataset_created()
|
||||
46 | dm.notify_dataset_changed()
|
||||
|
|
||||
= help: Use `create_assets` instead
|
||||
help: Use `create_assets` instead
|
||||
|
||||
ℹ Safe fix
|
||||
41 41 | # airflow.datasets.manager
|
||||
@@ -233,16 +244,17 @@ AIR301_class_attribute.py:44:4: AIR301 [*] `create_datasets` is removed in Airfl
|
||||
46 46 | dm.notify_dataset_changed()
|
||||
47 47 | dm.notify_dataset_alias_created()
|
||||
|
||||
AIR301_class_attribute.py:45:4: AIR301 [*] `notify_dataset_created` is removed in Airflow 3.0
|
||||
AIR301 [*] `notify_dataset_created` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:45:4
|
||||
|
|
||||
43 | dm.register_dataset_change()
|
||||
44 | dm.create_datasets()
|
||||
45 | dm.notify_dataset_created()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
46 | dm.notify_dataset_changed()
|
||||
47 | dm.notify_dataset_alias_created()
|
||||
|
|
||||
= help: Use `notify_asset_created` instead
|
||||
help: Use `notify_asset_created` instead
|
||||
|
||||
ℹ Safe fix
|
||||
42 42 | dm = DatasetManager()
|
||||
@@ -254,15 +266,16 @@ AIR301_class_attribute.py:45:4: AIR301 [*] `notify_dataset_created` is removed i
|
||||
47 47 | dm.notify_dataset_alias_created()
|
||||
48 48 |
|
||||
|
||||
AIR301_class_attribute.py:46:4: AIR301 [*] `notify_dataset_changed` is removed in Airflow 3.0
|
||||
AIR301 [*] `notify_dataset_changed` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:46:4
|
||||
|
|
||||
44 | dm.create_datasets()
|
||||
45 | dm.notify_dataset_created()
|
||||
46 | dm.notify_dataset_changed()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
47 | dm.notify_dataset_alias_created()
|
||||
|
|
||||
= help: Use `notify_asset_changed` instead
|
||||
help: Use `notify_asset_changed` instead
|
||||
|
||||
ℹ Safe fix
|
||||
43 43 | dm.register_dataset_change()
|
||||
@@ -274,16 +287,17 @@ AIR301_class_attribute.py:46:4: AIR301 [*] `notify_dataset_changed` is removed i
|
||||
48 48 |
|
||||
49 49 | # airflow.lineage.hook
|
||||
|
||||
AIR301_class_attribute.py:47:4: AIR301 [*] `notify_dataset_alias_created` is removed in Airflow 3.0
|
||||
AIR301 [*] `notify_dataset_alias_created` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:47:4
|
||||
|
|
||||
45 | dm.notify_dataset_created()
|
||||
46 | dm.notify_dataset_changed()
|
||||
47 | dm.notify_dataset_alias_created()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
48 |
|
||||
49 | # airflow.lineage.hook
|
||||
|
|
||||
= help: Use `notify_asset_alias_created` instead
|
||||
help: Use `notify_asset_alias_created` instead
|
||||
|
||||
ℹ Safe fix
|
||||
44 44 | dm.create_datasets()
|
||||
@@ -295,14 +309,15 @@ AIR301_class_attribute.py:47:4: AIR301 [*] `notify_dataset_alias_created` is rem
|
||||
49 49 | # airflow.lineage.hook
|
||||
50 50 | dl_info = DatasetLineageInfo()
|
||||
|
||||
AIR301_class_attribute.py:50:11: AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:50:11
|
||||
|
|
||||
49 | # airflow.lineage.hook
|
||||
50 | dl_info = DatasetLineageInfo()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
51 | dl_info.dataset
|
||||
|
|
||||
= help: Use `AssetLineageInfo` from `airflow.lineage.hook` instead.
|
||||
help: Use `AssetLineageInfo` from `airflow.lineage.hook` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
9 9 | DatasetAny,
|
||||
@@ -323,16 +338,17 @@ AIR301_class_attribute.py:50:11: AIR301 [*] `airflow.lineage.hook.DatasetLineage
|
||||
52 52 |
|
||||
53 53 | hlc = HookLineageCollector()
|
||||
|
||||
AIR301_class_attribute.py:51:9: AIR301 [*] `dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `dataset` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:51:9
|
||||
|
|
||||
49 | # airflow.lineage.hook
|
||||
50 | dl_info = DatasetLineageInfo()
|
||||
51 | dl_info.dataset
|
||||
| ^^^^^^^ AIR301
|
||||
| ^^^^^^^
|
||||
52 |
|
||||
53 | hlc = HookLineageCollector()
|
||||
|
|
||||
= help: Use `asset` instead
|
||||
help: Use `asset` instead
|
||||
|
||||
ℹ Safe fix
|
||||
48 48 |
|
||||
@@ -344,15 +360,16 @@ AIR301_class_attribute.py:51:9: AIR301 [*] `dataset` is removed in Airflow 3.0
|
||||
53 53 | hlc = HookLineageCollector()
|
||||
54 54 | hlc.create_dataset()
|
||||
|
||||
AIR301_class_attribute.py:54:5: AIR301 [*] `create_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `create_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:54:5
|
||||
|
|
||||
53 | hlc = HookLineageCollector()
|
||||
54 | hlc.create_dataset()
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
55 | hlc.add_input_dataset()
|
||||
56 | hlc.add_output_dataset()
|
||||
|
|
||||
= help: Use `create_asset` instead
|
||||
help: Use `create_asset` instead
|
||||
|
||||
ℹ Safe fix
|
||||
51 51 | dl_info.dataset
|
||||
@@ -364,16 +381,17 @@ AIR301_class_attribute.py:54:5: AIR301 [*] `create_dataset` is removed in Airflo
|
||||
56 56 | hlc.add_output_dataset()
|
||||
57 57 | hlc.collected_datasets()
|
||||
|
||||
AIR301_class_attribute.py:55:5: AIR301 [*] `add_input_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `add_input_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:55:5
|
||||
|
|
||||
53 | hlc = HookLineageCollector()
|
||||
54 | hlc.create_dataset()
|
||||
55 | hlc.add_input_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
56 | hlc.add_output_dataset()
|
||||
57 | hlc.collected_datasets()
|
||||
|
|
||||
= help: Use `add_input_asset` instead
|
||||
help: Use `add_input_asset` instead
|
||||
|
||||
ℹ Safe fix
|
||||
52 52 |
|
||||
@@ -385,15 +403,16 @@ AIR301_class_attribute.py:55:5: AIR301 [*] `add_input_dataset` is removed in Air
|
||||
57 57 | hlc.collected_datasets()
|
||||
58 58 |
|
||||
|
||||
AIR301_class_attribute.py:56:5: AIR301 [*] `add_output_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `add_output_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:56:5
|
||||
|
|
||||
54 | hlc.create_dataset()
|
||||
55 | hlc.add_input_dataset()
|
||||
56 | hlc.add_output_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
57 | hlc.collected_datasets()
|
||||
|
|
||||
= help: Use `add_output_asset` instead
|
||||
help: Use `add_output_asset` instead
|
||||
|
||||
ℹ Safe fix
|
||||
53 53 | hlc = HookLineageCollector()
|
||||
@@ -405,16 +424,17 @@ AIR301_class_attribute.py:56:5: AIR301 [*] `add_output_dataset` is removed in Ai
|
||||
58 58 |
|
||||
59 59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
|
||||
|
||||
AIR301_class_attribute.py:57:5: AIR301 [*] `collected_datasets` is removed in Airflow 3.0
|
||||
AIR301 [*] `collected_datasets` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:57:5
|
||||
|
|
||||
55 | hlc.add_input_dataset()
|
||||
56 | hlc.add_output_dataset()
|
||||
57 | hlc.collected_datasets()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
58 |
|
||||
59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
|
||||
|
|
||||
= help: Use `collected_assets` instead
|
||||
help: Use `collected_assets` instead
|
||||
|
||||
ℹ Safe fix
|
||||
54 54 | hlc.create_dataset()
|
||||
@@ -426,16 +446,17 @@ AIR301_class_attribute.py:57:5: AIR301 [*] `collected_datasets` is removed in Ai
|
||||
59 59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
|
||||
60 60 | aam = AwsAuthManager()
|
||||
|
||||
AIR301_class_attribute.py:61:5: AIR301 [*] `is_authorized_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `is_authorized_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:61:5
|
||||
|
|
||||
59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
|
||||
60 | aam = AwsAuthManager()
|
||||
61 | aam.is_authorized_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
62 |
|
||||
63 | # airflow.providers.apache.beam.hooks
|
||||
|
|
||||
= help: Use `is_authorized_asset` instead
|
||||
help: Use `is_authorized_asset` instead
|
||||
|
||||
ℹ Safe fix
|
||||
58 58 |
|
||||
@@ -447,15 +468,16 @@ AIR301_class_attribute.py:61:5: AIR301 [*] `is_authorized_dataset` is removed in
|
||||
63 63 | # airflow.providers.apache.beam.hooks
|
||||
64 64 | # check get_conn_uri is caught if the class inherits from an airflow hook
|
||||
|
||||
AIR301_class_attribute.py:73:13: AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
|
||||
AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:73:13
|
||||
|
|
||||
71 | # airflow.providers.google.cloud.secrets.secret_manager
|
||||
72 | csm_backend = CloudSecretManagerBackend()
|
||||
73 | csm_backend.get_conn_uri()
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
74 | csm_backend.get_connections()
|
||||
|
|
||||
= help: Use `get_conn_value` instead
|
||||
help: Use `get_conn_value` instead
|
||||
|
||||
ℹ Safe fix
|
||||
70 70 |
|
||||
@@ -467,16 +489,17 @@ AIR301_class_attribute.py:73:13: AIR301 [*] `get_conn_uri` is removed in Airflow
|
||||
75 75 |
|
||||
76 76 | # airflow.providers.hashicorp.secrets.vault
|
||||
|
||||
AIR301_class_attribute.py:74:13: AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:74:13
|
||||
|
|
||||
72 | csm_backend = CloudSecretManagerBackend()
|
||||
73 | csm_backend.get_conn_uri()
|
||||
74 | csm_backend.get_connections()
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^
|
||||
75 |
|
||||
76 | # airflow.providers.hashicorp.secrets.vault
|
||||
|
|
||||
= help: Use `get_connection` instead
|
||||
help: Use `get_connection` instead
|
||||
|
||||
ℹ Safe fix
|
||||
71 71 | # airflow.providers.google.cloud.secrets.secret_manager
|
||||
@@ -488,15 +511,16 @@ AIR301_class_attribute.py:74:13: AIR301 [*] `get_connections` is removed in Airf
|
||||
76 76 | # airflow.providers.hashicorp.secrets.vault
|
||||
77 77 | vault_backend = VaultBackend()
|
||||
|
||||
AIR301_class_attribute.py:78:15: AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
|
||||
AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:78:15
|
||||
|
|
||||
76 | # airflow.providers.hashicorp.secrets.vault
|
||||
77 | vault_backend = VaultBackend()
|
||||
78 | vault_backend.get_conn_uri()
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
79 | vault_backend.get_connections()
|
||||
|
|
||||
= help: Use `get_conn_value` instead
|
||||
help: Use `get_conn_value` instead
|
||||
|
||||
ℹ Safe fix
|
||||
75 75 |
|
||||
@@ -508,16 +532,17 @@ AIR301_class_attribute.py:78:15: AIR301 [*] `get_conn_uri` is removed in Airflow
|
||||
80 80 |
|
||||
81 81 | not_an_error = NotAir302SecretError()
|
||||
|
||||
AIR301_class_attribute.py:79:15: AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:79:15
|
||||
|
|
||||
77 | vault_backend = VaultBackend()
|
||||
78 | vault_backend.get_conn_uri()
|
||||
79 | vault_backend.get_connections()
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^
|
||||
80 |
|
||||
81 | not_an_error = NotAir302SecretError()
|
||||
|
|
||||
= help: Use `get_connection` instead
|
||||
help: Use `get_connection` instead
|
||||
|
||||
ℹ Safe fix
|
||||
76 76 | # airflow.providers.hashicorp.secrets.vault
|
||||
@@ -529,16 +554,17 @@ AIR301_class_attribute.py:79:15: AIR301 [*] `get_connections` is removed in Airf
|
||||
81 81 | not_an_error = NotAir302SecretError()
|
||||
82 82 | not_an_error.get_conn_uri()
|
||||
|
||||
AIR301_class_attribute.py:86:4: AIR301 [*] `initialize_providers_dataset_uri_resources` is removed in Airflow 3.0
|
||||
AIR301 [*] `initialize_providers_dataset_uri_resources` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:86:4
|
||||
|
|
||||
84 | # airflow.providers_manager
|
||||
85 | pm = ProvidersManager()
|
||||
86 | pm.initialize_providers_dataset_uri_resources()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
87 | pm.dataset_factories
|
||||
88 | pm.dataset_uri_handlers
|
||||
|
|
||||
= help: Use `initialize_providers_asset_uri_resources` instead
|
||||
help: Use `initialize_providers_asset_uri_resources` instead
|
||||
|
||||
ℹ Safe fix
|
||||
83 83 |
|
||||
@@ -550,16 +576,17 @@ AIR301_class_attribute.py:86:4: AIR301 [*] `initialize_providers_dataset_uri_res
|
||||
88 88 | pm.dataset_uri_handlers
|
||||
89 89 | pm.dataset_to_openlineage_converters
|
||||
|
||||
AIR301_class_attribute.py:87:4: AIR301 [*] `dataset_factories` is removed in Airflow 3.0
|
||||
AIR301 [*] `dataset_factories` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:87:4
|
||||
|
|
||||
85 | pm = ProvidersManager()
|
||||
86 | pm.initialize_providers_dataset_uri_resources()
|
||||
87 | pm.dataset_factories
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
88 | pm.dataset_uri_handlers
|
||||
89 | pm.dataset_to_openlineage_converters
|
||||
|
|
||||
= help: Use `asset_factories` instead
|
||||
help: Use `asset_factories` instead
|
||||
|
||||
ℹ Safe fix
|
||||
84 84 | # airflow.providers_manager
|
||||
@@ -571,15 +598,16 @@ AIR301_class_attribute.py:87:4: AIR301 [*] `dataset_factories` is removed in Air
|
||||
89 89 | pm.dataset_to_openlineage_converters
|
||||
90 90 |
|
||||
|
||||
AIR301_class_attribute.py:88:4: AIR301 [*] `dataset_uri_handlers` is removed in Airflow 3.0
|
||||
AIR301 [*] `dataset_uri_handlers` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:88:4
|
||||
|
|
||||
86 | pm.initialize_providers_dataset_uri_resources()
|
||||
87 | pm.dataset_factories
|
||||
88 | pm.dataset_uri_handlers
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
89 | pm.dataset_to_openlineage_converters
|
||||
|
|
||||
= help: Use `asset_uri_handlers` instead
|
||||
help: Use `asset_uri_handlers` instead
|
||||
|
||||
ℹ Safe fix
|
||||
85 85 | pm = ProvidersManager()
|
||||
@@ -591,16 +619,17 @@ AIR301_class_attribute.py:88:4: AIR301 [*] `dataset_uri_handlers` is removed in
|
||||
90 90 |
|
||||
91 91 | # airflow.secrets.base_secrets
|
||||
|
||||
AIR301_class_attribute.py:89:4: AIR301 [*] `dataset_to_openlineage_converters` is removed in Airflow 3.0
|
||||
AIR301 [*] `dataset_to_openlineage_converters` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:89:4
|
||||
|
|
||||
87 | pm.dataset_factories
|
||||
88 | pm.dataset_uri_handlers
|
||||
89 | pm.dataset_to_openlineage_converters
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
90 |
|
||||
91 | # airflow.secrets.base_secrets
|
||||
|
|
||||
= help: Use `asset_to_openlineage_converters` instead
|
||||
help: Use `asset_to_openlineage_converters` instead
|
||||
|
||||
ℹ Safe fix
|
||||
86 86 | pm.initialize_providers_dataset_uri_resources()
|
||||
@@ -612,15 +641,16 @@ AIR301_class_attribute.py:89:4: AIR301 [*] `dataset_to_openlineage_converters` i
|
||||
91 91 | # airflow.secrets.base_secrets
|
||||
92 92 | base_secret_backend = BaseSecretsBackend()
|
||||
|
||||
AIR301_class_attribute.py:93:21: AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
|
||||
AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:93:21
|
||||
|
|
||||
91 | # airflow.secrets.base_secrets
|
||||
92 | base_secret_backend = BaseSecretsBackend()
|
||||
93 | base_secret_backend.get_conn_uri()
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
94 | base_secret_backend.get_connections()
|
||||
|
|
||||
= help: Use `get_conn_value` instead
|
||||
help: Use `get_conn_value` instead
|
||||
|
||||
ℹ Safe fix
|
||||
90 90 |
|
||||
@@ -632,16 +662,17 @@ AIR301_class_attribute.py:93:21: AIR301 [*] `get_conn_uri` is removed in Airflow
|
||||
95 95 |
|
||||
96 96 | # airflow.secrets.local_filesystem
|
||||
|
||||
AIR301_class_attribute.py:94:21: AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:94:21
|
||||
|
|
||||
92 | base_secret_backend = BaseSecretsBackend()
|
||||
93 | base_secret_backend.get_conn_uri()
|
||||
94 | base_secret_backend.get_connections()
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^
|
||||
95 |
|
||||
96 | # airflow.secrets.local_filesystem
|
||||
|
|
||||
= help: Use `get_connection` instead
|
||||
help: Use `get_connection` instead
|
||||
|
||||
ℹ Safe fix
|
||||
91 91 | # airflow.secrets.base_secrets
|
||||
@@ -653,14 +684,15 @@ AIR301_class_attribute.py:94:21: AIR301 [*] `get_connections` is removed in Airf
|
||||
96 96 | # airflow.secrets.local_filesystem
|
||||
97 97 | lfb = LocalFilesystemBackend()
|
||||
|
||||
AIR301_class_attribute.py:98:5: AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
AIR301 [*] `get_connections` is removed in Airflow 3.0
|
||||
--> AIR301_class_attribute.py:98:5
|
||||
|
|
||||
96 | # airflow.secrets.local_filesystem
|
||||
97 | lfb = LocalFilesystemBackend()
|
||||
98 | lfb.get_connections()
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Use `get_connection` instead
|
||||
help: Use `get_connection` instead
|
||||
|
||||
ℹ Safe fix
|
||||
95 95 |
|
||||
|
||||
@@ -1,310 +1,342 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR301_context.py:22:41: AIR301 `conf` is removed in Airflow 3.0
|
||||
AIR301 `conf` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:22:41
|
||||
|
|
||||
20 | @task
|
||||
21 | def access_invalid_key_task_out_of_dag(**context):
|
||||
22 | print("access invalid key", context["conf"])
|
||||
| ^^^^^^ AIR301
|
||||
| ^^^^^^
|
||||
23 | print("access invalid key", context.get("conf"))
|
||||
|
|
||||
|
||||
AIR301_context.py:23:45: AIR301 `conf` is removed in Airflow 3.0
|
||||
AIR301 `conf` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:23:45
|
||||
|
|
||||
21 | def access_invalid_key_task_out_of_dag(**context):
|
||||
22 | print("access invalid key", context["conf"])
|
||||
23 | print("access invalid key", context.get("conf"))
|
||||
| ^^^^^^ AIR301
|
||||
| ^^^^^^
|
||||
|
|
||||
|
||||
AIR301_context.py:28:5: AIR301 `execution_date` is removed in Airflow 3.0
|
||||
AIR301 `execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:28:5
|
||||
|
|
||||
26 | @task
|
||||
27 | def access_invalid_argument_task_out_of_dag(
|
||||
28 | execution_date, tomorrow_ds, logical_date, **context
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
29 | ):
|
||||
30 | print("execution date", execution_date)
|
||||
|
|
||||
|
||||
AIR301_context.py:28:21: AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:28:21
|
||||
|
|
||||
26 | @task
|
||||
27 | def access_invalid_argument_task_out_of_dag(
|
||||
28 | execution_date, tomorrow_ds, logical_date, **context
|
||||
| ^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^
|
||||
29 | ):
|
||||
30 | print("execution date", execution_date)
|
||||
|
|
||||
|
||||
AIR301_context.py:31:45: AIR301 `conf` is removed in Airflow 3.0
|
||||
AIR301 `conf` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:31:45
|
||||
|
|
||||
29 | ):
|
||||
30 | print("execution date", execution_date)
|
||||
31 | print("access invalid key", context.get("conf"))
|
||||
| ^^^^^^ AIR301
|
||||
| ^^^^^^
|
||||
|
|
||||
|
||||
AIR301_context.py:40:30: AIR301 `execution_date` is removed in Airflow 3.0
|
||||
AIR301 `execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:40:30
|
||||
|
|
||||
39 | # Removed usage - should trigger violations
|
||||
40 | execution_date = context["execution_date"]
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
41 | next_ds = context["next_ds"]
|
||||
42 | next_ds_nodash = context["next_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:41:23: AIR301 `next_ds` is removed in Airflow 3.0
|
||||
AIR301 `next_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:41:23
|
||||
|
|
||||
39 | # Removed usage - should trigger violations
|
||||
40 | execution_date = context["execution_date"]
|
||||
41 | next_ds = context["next_ds"]
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
42 | next_ds_nodash = context["next_ds_nodash"]
|
||||
43 | next_execution_date = context["next_execution_date"]
|
||||
|
|
||||
|
||||
AIR301_context.py:42:30: AIR301 `next_ds_nodash` is removed in Airflow 3.0
|
||||
AIR301 `next_ds_nodash` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:42:30
|
||||
|
|
||||
40 | execution_date = context["execution_date"]
|
||||
41 | next_ds = context["next_ds"]
|
||||
42 | next_ds_nodash = context["next_ds_nodash"]
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
43 | next_execution_date = context["next_execution_date"]
|
||||
44 | prev_ds = context["prev_ds"]
|
||||
|
|
||||
|
||||
AIR301_context.py:43:35: AIR301 `next_execution_date` is removed in Airflow 3.0
|
||||
AIR301 `next_execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:43:35
|
||||
|
|
||||
41 | next_ds = context["next_ds"]
|
||||
42 | next_ds_nodash = context["next_ds_nodash"]
|
||||
43 | next_execution_date = context["next_execution_date"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
44 | prev_ds = context["prev_ds"]
|
||||
45 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:44:23: AIR301 `prev_ds` is removed in Airflow 3.0
|
||||
AIR301 `prev_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:44:23
|
||||
|
|
||||
42 | next_ds_nodash = context["next_ds_nodash"]
|
||||
43 | next_execution_date = context["next_execution_date"]
|
||||
44 | prev_ds = context["prev_ds"]
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
45 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
46 | prev_execution_date = context["prev_execution_date"]
|
||||
|
|
||||
|
||||
AIR301_context.py:45:30: AIR301 `prev_ds_nodash` is removed in Airflow 3.0
|
||||
AIR301 `prev_ds_nodash` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:45:30
|
||||
|
|
||||
43 | next_execution_date = context["next_execution_date"]
|
||||
44 | prev_ds = context["prev_ds"]
|
||||
45 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
46 | prev_execution_date = context["prev_execution_date"]
|
||||
47 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
|
|
||||
|
||||
AIR301_context.py:46:35: AIR301 `prev_execution_date` is removed in Airflow 3.0
|
||||
AIR301 `prev_execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:46:35
|
||||
|
|
||||
44 | prev_ds = context["prev_ds"]
|
||||
45 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
46 | prev_execution_date = context["prev_execution_date"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
47 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
48 | tomorrow_ds = context["tomorrow_ds"]
|
||||
|
|
||||
|
||||
AIR301_context.py:47:43: AIR301 `prev_execution_date_success` is removed in Airflow 3.0
|
||||
AIR301 `prev_execution_date_success` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:47:43
|
||||
|
|
||||
45 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
46 | prev_execution_date = context["prev_execution_date"]
|
||||
47 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
48 | tomorrow_ds = context["tomorrow_ds"]
|
||||
49 | yesterday_ds = context["yesterday_ds"]
|
||||
|
|
||||
|
||||
AIR301_context.py:48:27: AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:48:27
|
||||
|
|
||||
46 | prev_execution_date = context["prev_execution_date"]
|
||||
47 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
48 | tomorrow_ds = context["tomorrow_ds"]
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
49 | yesterday_ds = context["yesterday_ds"]
|
||||
50 | yesterday_ds_nodash = context["yesterday_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:49:28: AIR301 `yesterday_ds` is removed in Airflow 3.0
|
||||
AIR301 `yesterday_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:49:28
|
||||
|
|
||||
47 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
48 | tomorrow_ds = context["tomorrow_ds"]
|
||||
49 | yesterday_ds = context["yesterday_ds"]
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
50 | yesterday_ds_nodash = context["yesterday_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:50:35: AIR301 `yesterday_ds_nodash` is removed in Airflow 3.0
|
||||
AIR301 `yesterday_ds_nodash` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:50:35
|
||||
|
|
||||
48 | tomorrow_ds = context["tomorrow_ds"]
|
||||
49 | yesterday_ds = context["yesterday_ds"]
|
||||
50 | yesterday_ds_nodash = context["yesterday_ds_nodash"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
AIR301_context.py:56:30: AIR301 `execution_date` is removed in Airflow 3.0
|
||||
AIR301 `execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:56:30
|
||||
|
|
||||
54 | def print_config_with_get_current_context():
|
||||
55 | context = get_current_context()
|
||||
56 | execution_date = context["execution_date"]
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
57 | next_ds = context["next_ds"]
|
||||
58 | next_ds_nodash = context["next_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:57:23: AIR301 `next_ds` is removed in Airflow 3.0
|
||||
AIR301 `next_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:57:23
|
||||
|
|
||||
55 | context = get_current_context()
|
||||
56 | execution_date = context["execution_date"]
|
||||
57 | next_ds = context["next_ds"]
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
58 | next_ds_nodash = context["next_ds_nodash"]
|
||||
59 | next_execution_date = context["next_execution_date"]
|
||||
|
|
||||
|
||||
AIR301_context.py:58:30: AIR301 `next_ds_nodash` is removed in Airflow 3.0
|
||||
AIR301 `next_ds_nodash` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:58:30
|
||||
|
|
||||
56 | execution_date = context["execution_date"]
|
||||
57 | next_ds = context["next_ds"]
|
||||
58 | next_ds_nodash = context["next_ds_nodash"]
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
59 | next_execution_date = context["next_execution_date"]
|
||||
60 | prev_ds = context["prev_ds"]
|
||||
|
|
||||
|
||||
AIR301_context.py:59:35: AIR301 `next_execution_date` is removed in Airflow 3.0
|
||||
AIR301 `next_execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:59:35
|
||||
|
|
||||
57 | next_ds = context["next_ds"]
|
||||
58 | next_ds_nodash = context["next_ds_nodash"]
|
||||
59 | next_execution_date = context["next_execution_date"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
60 | prev_ds = context["prev_ds"]
|
||||
61 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:60:23: AIR301 `prev_ds` is removed in Airflow 3.0
|
||||
AIR301 `prev_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:60:23
|
||||
|
|
||||
58 | next_ds_nodash = context["next_ds_nodash"]
|
||||
59 | next_execution_date = context["next_execution_date"]
|
||||
60 | prev_ds = context["prev_ds"]
|
||||
| ^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^
|
||||
61 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
62 | prev_execution_date = context["prev_execution_date"]
|
||||
|
|
||||
|
||||
AIR301_context.py:61:30: AIR301 `prev_ds_nodash` is removed in Airflow 3.0
|
||||
AIR301 `prev_ds_nodash` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:61:30
|
||||
|
|
||||
59 | next_execution_date = context["next_execution_date"]
|
||||
60 | prev_ds = context["prev_ds"]
|
||||
61 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
62 | prev_execution_date = context["prev_execution_date"]
|
||||
63 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
|
|
||||
|
||||
AIR301_context.py:62:35: AIR301 `prev_execution_date` is removed in Airflow 3.0
|
||||
AIR301 `prev_execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:62:35
|
||||
|
|
||||
60 | prev_ds = context["prev_ds"]
|
||||
61 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
62 | prev_execution_date = context["prev_execution_date"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
63 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
64 | tomorrow_ds = context["tomorrow_ds"]
|
||||
|
|
||||
|
||||
AIR301_context.py:63:43: AIR301 `prev_execution_date_success` is removed in Airflow 3.0
|
||||
AIR301 `prev_execution_date_success` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:63:43
|
||||
|
|
||||
61 | prev_ds_nodash = context["prev_ds_nodash"]
|
||||
62 | prev_execution_date = context["prev_execution_date"]
|
||||
63 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
64 | tomorrow_ds = context["tomorrow_ds"]
|
||||
65 | yesterday_ds = context["yesterday_ds"]
|
||||
|
|
||||
|
||||
AIR301_context.py:64:27: AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:64:27
|
||||
|
|
||||
62 | prev_execution_date = context["prev_execution_date"]
|
||||
63 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
64 | tomorrow_ds = context["tomorrow_ds"]
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
65 | yesterday_ds = context["yesterday_ds"]
|
||||
66 | yesterday_ds_nodash = context["yesterday_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:65:28: AIR301 `yesterday_ds` is removed in Airflow 3.0
|
||||
AIR301 `yesterday_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:65:28
|
||||
|
|
||||
63 | prev_execution_date_success = context["prev_execution_date_success"]
|
||||
64 | tomorrow_ds = context["tomorrow_ds"]
|
||||
65 | yesterday_ds = context["yesterday_ds"]
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
66 | yesterday_ds_nodash = context["yesterday_ds_nodash"]
|
||||
|
|
||||
|
||||
AIR301_context.py:66:35: AIR301 `yesterday_ds_nodash` is removed in Airflow 3.0
|
||||
AIR301 `yesterday_ds_nodash` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:66:35
|
||||
|
|
||||
64 | tomorrow_ds = context["tomorrow_ds"]
|
||||
65 | yesterday_ds = context["yesterday_ds"]
|
||||
66 | yesterday_ds_nodash = context["yesterday_ds_nodash"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
AIR301_context.py:73:22: AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
AIR301 `tomorrow_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:73:22
|
||||
|
|
||||
71 | """Print the Airflow context and ds variable from the context."""
|
||||
72 | print(ds)
|
||||
73 | print(kwargs.get("tomorrow_ds"))
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
74 | c = get_current_context()
|
||||
75 | c.get("execution_date")
|
||||
|
|
||||
|
||||
AIR301_context.py:75:11: AIR301 `execution_date` is removed in Airflow 3.0
|
||||
AIR301 `execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:75:11
|
||||
|
|
||||
73 | print(kwargs.get("tomorrow_ds"))
|
||||
74 | c = get_current_context()
|
||||
75 | c.get("execution_date")
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
AIR301_context.py:87:49: AIR301 `conf` is removed in Airflow 3.0
|
||||
AIR301 `conf` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:87:49
|
||||
|
|
||||
85 | @task()
|
||||
86 | def access_invalid_key_task(**context):
|
||||
87 | print("access invalid key", context.get("conf"))
|
||||
| ^^^^^^ AIR301
|
||||
| ^^^^^^
|
||||
88 |
|
||||
89 | @task()
|
||||
|
|
||||
|
||||
AIR301_context.py:90:42: AIR301 `execution_date` is removed in Airflow 3.0
|
||||
AIR301 `execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:90:42
|
||||
|
|
||||
89 | @task()
|
||||
90 | def access_invalid_key_explicit_task(execution_date):
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
91 | print(execution_date)
|
||||
|
|
||||
|
||||
AIR301_context.py:111:5: AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
AIR301 [*] `schedule_interval` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:111:5
|
||||
|
|
||||
109 | with DAG(
|
||||
110 | dag_id="example_dag",
|
||||
111 | schedule_interval="@daily",
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
112 | start_date=datetime(2023, 1, 1),
|
||||
113 | template_searchpath=["/templates"],
|
||||
|
|
||||
= help: Use `schedule` instead
|
||||
help: Use `schedule` instead
|
||||
|
||||
ℹ Safe fix
|
||||
108 108 |
|
||||
@@ -316,11 +348,12 @@ AIR301_context.py:111:5: AIR301 [*] `schedule_interval` is removed in Airflow 3.
|
||||
113 113 | template_searchpath=["/templates"],
|
||||
114 114 | ) as dag:
|
||||
|
||||
AIR301_context.py:135:23: AIR301 `next_ds` is removed in Airflow 3.0
|
||||
AIR301 `next_ds` is removed in Airflow 3.0
|
||||
--> AIR301_context.py:135:23
|
||||
|
|
||||
134 | class CustomOperator(BaseOperator):
|
||||
135 | def execute(self, next_ds, context):
|
||||
| ^^^^^^^ AIR301
|
||||
| ^^^^^^^
|
||||
136 | execution_date = context["execution_date"]
|
||||
137 | next_ds = context["next_ds"]
|
||||
|
|
||||
|
||||
@@ -1,294 +1,352 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR301_names.py:38:1: AIR301 `airflow.PY36` is removed in Airflow 3.0
|
||||
AIR301 `airflow.PY36` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:39:1
|
||||
|
|
||||
37 | # airflow root
|
||||
38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^ AIR301
|
||||
39 |
|
||||
40 | # airflow.api_connexion.security
|
||||
38 | # airflow root
|
||||
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^
|
||||
40 |
|
||||
41 | # airflow.api_connexion.security
|
||||
|
|
||||
= help: Use `sys.version_info` instead
|
||||
help: Use `sys.version_info` instead
|
||||
|
||||
AIR301_names.py:38:7: AIR301 `airflow.PY37` is removed in Airflow 3.0
|
||||
AIR301 `airflow.PY37` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:39:7
|
||||
|
|
||||
37 | # airflow root
|
||||
38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^ AIR301
|
||||
39 |
|
||||
40 | # airflow.api_connexion.security
|
||||
38 | # airflow root
|
||||
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^
|
||||
40 |
|
||||
41 | # airflow.api_connexion.security
|
||||
|
|
||||
= help: Use `sys.version_info` instead
|
||||
help: Use `sys.version_info` instead
|
||||
|
||||
AIR301_names.py:38:13: AIR301 `airflow.PY38` is removed in Airflow 3.0
|
||||
AIR301 `airflow.PY38` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:39:13
|
||||
|
|
||||
37 | # airflow root
|
||||
38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^ AIR301
|
||||
39 |
|
||||
40 | # airflow.api_connexion.security
|
||||
38 | # airflow root
|
||||
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^
|
||||
40 |
|
||||
41 | # airflow.api_connexion.security
|
||||
|
|
||||
= help: Use `sys.version_info` instead
|
||||
help: Use `sys.version_info` instead
|
||||
|
||||
AIR301_names.py:38:19: AIR301 `airflow.PY39` is removed in Airflow 3.0
|
||||
AIR301 `airflow.PY39` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:39:19
|
||||
|
|
||||
37 | # airflow root
|
||||
38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^ AIR301
|
||||
39 |
|
||||
40 | # airflow.api_connexion.security
|
||||
38 | # airflow root
|
||||
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^
|
||||
40 |
|
||||
41 | # airflow.api_connexion.security
|
||||
|
|
||||
= help: Use `sys.version_info` instead
|
||||
help: Use `sys.version_info` instead
|
||||
|
||||
AIR301_names.py:38:25: AIR301 `airflow.PY310` is removed in Airflow 3.0
|
||||
AIR301 `airflow.PY310` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:39:25
|
||||
|
|
||||
37 | # airflow root
|
||||
38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^^ AIR301
|
||||
39 |
|
||||
40 | # airflow.api_connexion.security
|
||||
38 | # airflow root
|
||||
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^^
|
||||
40 |
|
||||
41 | # airflow.api_connexion.security
|
||||
|
|
||||
= help: Use `sys.version_info` instead
|
||||
help: Use `sys.version_info` instead
|
||||
|
||||
AIR301_names.py:38:32: AIR301 `airflow.PY311` is removed in Airflow 3.0
|
||||
AIR301 `airflow.PY311` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:39:32
|
||||
|
|
||||
37 | # airflow root
|
||||
38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^^ AIR301
|
||||
39 |
|
||||
40 | # airflow.api_connexion.security
|
||||
38 | # airflow root
|
||||
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^^
|
||||
40 |
|
||||
41 | # airflow.api_connexion.security
|
||||
|
|
||||
= help: Use `sys.version_info` instead
|
||||
help: Use `sys.version_info` instead
|
||||
|
||||
AIR301_names.py:38:39: AIR301 `airflow.PY312` is removed in Airflow 3.0
|
||||
AIR301 `airflow.PY312` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:39:39
|
||||
|
|
||||
37 | # airflow root
|
||||
38 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^^ AIR301
|
||||
39 |
|
||||
40 | # airflow.api_connexion.security
|
||||
38 | # airflow root
|
||||
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
| ^^^^^
|
||||
40 |
|
||||
41 | # airflow.api_connexion.security
|
||||
|
|
||||
= help: Use `sys.version_info` instead
|
||||
help: Use `sys.version_info` instead
|
||||
|
||||
AIR301_names.py:41:1: AIR301 `airflow.api_connexion.security.requires_access` is removed in Airflow 3.0
|
||||
AIR301 `airflow.api_connexion.security.requires_access` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:42:1
|
||||
|
|
||||
40 | # airflow.api_connexion.security
|
||||
41 | requires_access
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
42 |
|
||||
43 | # airflow.contrib.*
|
||||
41 | # airflow.api_connexion.security
|
||||
42 | requires_access
|
||||
| ^^^^^^^^^^^^^^^
|
||||
43 |
|
||||
44 | # airflow.contrib.*
|
||||
|
|
||||
= help: Use `airflow.api_fastapi.core_api.security.requires_access_*` instead
|
||||
help: Use `airflow.api_fastapi.core_api.security.requires_access_*` instead
|
||||
|
||||
AIR301_names.py:44:1: AIR301 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is removed in Airflow 3.0
|
||||
AIR301 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:45:1
|
||||
|
|
||||
43 | # airflow.contrib.*
|
||||
44 | AWSAthenaHook()
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
44 | # airflow.contrib.*
|
||||
45 | AWSAthenaHook()
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: The whole `airflow.contrib` module has been removed.
|
||||
help: The whole `airflow.contrib` module has been removed.
|
||||
|
||||
AIR301_names.py:48:1: AIR301 `airflow.datasets.DatasetAliasEvent` is removed in Airflow 3.0
|
||||
AIR301 `airflow.datasets.DatasetAliasEvent` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:49:1
|
||||
|
|
||||
47 | # airflow.datasets
|
||||
48 | DatasetAliasEvent()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
48 | # airflow.datasets
|
||||
49 | DatasetAliasEvent()
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
AIR301_names.py:52:1: AIR301 `airflow.operators.subdag.SubDagOperator` is removed in Airflow 3.0
|
||||
AIR301 `airflow.operators.subdag.SubDagOperator` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:53:1
|
||||
|
|
||||
51 | # airflow.operators.subdag.*
|
||||
52 | SubDagOperator()
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
52 | # airflow.operators.subdag.*
|
||||
53 | SubDagOperator()
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: The whole `airflow.subdag` module has been removed.
|
||||
help: The whole `airflow.subdag` module has been removed.
|
||||
|
||||
AIR301_names.py:61:1: AIR301 `airflow.triggers.external_task.TaskStateTrigger` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.secrets.cache.SecretCache` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:61:1
|
||||
|
|
||||
60 | # airflow.triggers.external_task
|
||||
61 | TaskStateTrigger()
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
62 |
|
||||
63 | # airflow.utils.date
|
||||
60 | # airflow.secrets.cache
|
||||
61 | SecretCache()
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
help: Use `SecretCache` from `airflow.sdk` instead.
|
||||
|
||||
AIR301_names.py:64:1: AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0
|
||||
|
|
||||
63 | # airflow.utils.date
|
||||
64 | dates.date_range
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
65 | dates.days_ago
|
||||
|
|
||||
ℹ Unsafe fix
|
||||
13 13 | from airflow.contrib.aws_athena_hook import AWSAthenaHook
|
||||
14 14 | from airflow.datasets import DatasetAliasEvent
|
||||
15 15 | from airflow.operators.subdag import SubDagOperator
|
||||
16 |-from airflow.secrets.cache import SecretCache
|
||||
17 16 | from airflow.secrets.local_filesystem import LocalFilesystemBackend
|
||||
18 17 | from airflow.triggers.external_task import TaskStateTrigger
|
||||
19 18 | from airflow.utils import dates
|
||||
--------------------------------------------------------------------------------
|
||||
34 33 | from airflow.utils.trigger_rule import TriggerRule
|
||||
35 34 | from airflow.www.auth import has_access, has_access_dataset
|
||||
36 35 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
|
||||
36 |+from airflow.sdk import SecretCache
|
||||
37 37 |
|
||||
38 38 | # airflow root
|
||||
39 39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
|
||||
|
||||
AIR301_names.py:65:1: AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
|
||||
AIR301 `airflow.triggers.external_task.TaskStateTrigger` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:65:1
|
||||
|
|
||||
63 | # airflow.utils.date
|
||||
64 | dates.date_range
|
||||
65 | dates.days_ago
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
64 | # airflow.triggers.external_task
|
||||
65 | TaskStateTrigger()
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
66 |
|
||||
67 | date_range
|
||||
|
|
||||
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
|
||||
|
||||
AIR301_names.py:67:1: AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0
|
||||
|
|
||||
65 | dates.days_ago
|
||||
66 |
|
||||
67 | date_range
|
||||
| ^^^^^^^^^^ AIR301
|
||||
68 | days_ago
|
||||
69 | infer_time_unit
|
||||
67 | # airflow.utils.date
|
||||
|
|
||||
|
||||
AIR301_names.py:68:1: AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:68:1
|
||||
|
|
||||
67 | date_range
|
||||
68 | days_ago
|
||||
| ^^^^^^^^ AIR301
|
||||
69 | infer_time_unit
|
||||
70 | parse_execution_date
|
||||
|
|
||||
= help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
|
||||
|
||||
AIR301_names.py:69:1: AIR301 `airflow.utils.dates.infer_time_unit` is removed in Airflow 3.0
|
||||
|
|
||||
67 | date_range
|
||||
68 | days_ago
|
||||
69 | infer_time_unit
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
70 | parse_execution_date
|
||||
71 | round_time
|
||||
67 | # airflow.utils.date
|
||||
68 | dates.date_range
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
69 | dates.days_ago
|
||||
|
|
||||
|
||||
AIR301_names.py:70:1: AIR301 `airflow.utils.dates.parse_execution_date` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:69:1
|
||||
|
|
||||
68 | days_ago
|
||||
69 | infer_time_unit
|
||||
70 | parse_execution_date
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
71 | round_time
|
||||
72 | scale_time_units
|
||||
67 | # airflow.utils.date
|
||||
68 | dates.date_range
|
||||
69 | dates.days_ago
|
||||
| ^^^^^^^^^^^^^^
|
||||
70 |
|
||||
71 | date_range
|
||||
|
|
||||
help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
|
||||
|
||||
AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:71:1
|
||||
|
|
||||
69 | dates.days_ago
|
||||
70 |
|
||||
71 | date_range
|
||||
| ^^^^^^^^^^
|
||||
72 | days_ago
|
||||
73 | infer_time_unit
|
||||
|
|
||||
|
||||
AIR301_names.py:71:1: AIR301 `airflow.utils.dates.round_time` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:72:1
|
||||
|
|
||||
69 | infer_time_unit
|
||||
70 | parse_execution_date
|
||||
71 | round_time
|
||||
| ^^^^^^^^^^ AIR301
|
||||
72 | scale_time_units
|
||||
71 | date_range
|
||||
72 | days_ago
|
||||
| ^^^^^^^^
|
||||
73 | infer_time_unit
|
||||
74 | parse_execution_date
|
||||
|
|
||||
help: Use `pendulum.today('UTC').add(days=-N, ...)` instead
|
||||
|
||||
AIR301 `airflow.utils.dates.infer_time_unit` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:73:1
|
||||
|
|
||||
71 | date_range
|
||||
72 | days_ago
|
||||
73 | infer_time_unit
|
||||
| ^^^^^^^^^^^^^^^
|
||||
74 | parse_execution_date
|
||||
75 | round_time
|
||||
|
|
||||
|
||||
AIR301_names.py:72:1: AIR301 `airflow.utils.dates.scale_time_units` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.dates.parse_execution_date` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:74:1
|
||||
|
|
||||
70 | parse_execution_date
|
||||
71 | round_time
|
||||
72 | scale_time_units
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
73 |
|
||||
74 | # This one was not deprecated.
|
||||
72 | days_ago
|
||||
73 | infer_time_unit
|
||||
74 | parse_execution_date
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
75 | round_time
|
||||
76 | scale_time_units
|
||||
|
|
||||
|
||||
AIR301_names.py:79:1: AIR301 `airflow.utils.dag_cycle_tester.test_cycle` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.dates.round_time` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:75:1
|
||||
|
|
||||
78 | # airflow.utils.dag_cycle_tester
|
||||
79 | test_cycle
|
||||
| ^^^^^^^^^^ AIR301
|
||||
73 | infer_time_unit
|
||||
74 | parse_execution_date
|
||||
75 | round_time
|
||||
| ^^^^^^^^^^
|
||||
76 | scale_time_units
|
||||
|
|
||||
|
||||
AIR301_names.py:83:1: AIR301 `airflow.utils.db.create_session` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.dates.scale_time_units` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:76:1
|
||||
|
|
||||
82 | # airflow.utils.db
|
||||
83 | create_session
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
84 |
|
||||
85 | # airflow.utils.decorators
|
||||
74 | parse_execution_date
|
||||
75 | round_time
|
||||
76 | scale_time_units
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
77 |
|
||||
78 | # This one was not deprecated.
|
||||
|
|
||||
|
||||
AIR301_names.py:86:1: AIR301 `airflow.utils.decorators.apply_defaults` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.dag_cycle_tester.test_cycle` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:83:1
|
||||
|
|
||||
85 | # airflow.utils.decorators
|
||||
86 | apply_defaults
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
87 |
|
||||
88 | # airflow.utils.file
|
||||
|
|
||||
= help: `apply_defaults` is now unconditionally done and can be safely removed.
|
||||
|
||||
AIR301_names.py:89:1: AIR301 `airflow.utils.file.mkdirs` is removed in Airflow 3.0
|
||||
|
|
||||
88 | # airflow.utils.file
|
||||
89 | mkdirs
|
||||
| ^^^^^^ AIR301
|
||||
|
|
||||
= help: Use `pathlib.Path({path}).mkdir` instead
|
||||
|
||||
AIR301_names.py:93:1: AIR301 `airflow.utils.state.SHUTDOWN` is removed in Airflow 3.0
|
||||
|
|
||||
92 | # airflow.utils.state
|
||||
93 | SHUTDOWN
|
||||
| ^^^^^^^^ AIR301
|
||||
94 | terminating_states
|
||||
82 | # airflow.utils.dag_cycle_tester
|
||||
83 | test_cycle
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
|
||||
AIR301_names.py:94:1: AIR301 `airflow.utils.state.terminating_states` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.db.create_session` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:87:1
|
||||
|
|
||||
92 | # airflow.utils.state
|
||||
93 | SHUTDOWN
|
||||
94 | terminating_states
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
95 |
|
||||
96 | # airflow.utils.trigger_rule
|
||||
86 | # airflow.utils.db
|
||||
87 | create_session
|
||||
| ^^^^^^^^^^^^^^
|
||||
88 |
|
||||
89 | # airflow.utils.decorators
|
||||
|
|
||||
|
||||
AIR301_names.py:97:1: AIR301 `airflow.utils.trigger_rule.TriggerRule.DUMMY` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.decorators.apply_defaults` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:90:1
|
||||
|
|
||||
96 | # airflow.utils.trigger_rule
|
||||
97 | TriggerRule.DUMMY
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
98 | TriggerRule.NONE_FAILED_OR_SKIPPED
|
||||
89 | # airflow.utils.decorators
|
||||
90 | apply_defaults
|
||||
| ^^^^^^^^^^^^^^
|
||||
91 |
|
||||
92 | # airflow.utils.file
|
||||
|
|
||||
help: `apply_defaults` is now unconditionally done and can be safely removed.
|
||||
|
||||
AIR301 `airflow.utils.file.mkdirs` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:93:1
|
||||
|
|
||||
92 | # airflow.utils.file
|
||||
93 | mkdirs
|
||||
| ^^^^^^
|
||||
|
|
||||
help: Use `pathlib.Path({path}).mkdir` instead
|
||||
|
||||
AIR301 `airflow.utils.state.SHUTDOWN` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:97:1
|
||||
|
|
||||
96 | # airflow.utils.state
|
||||
97 | SHUTDOWN
|
||||
| ^^^^^^^^
|
||||
98 | terminating_states
|
||||
|
|
||||
|
||||
AIR301_names.py:98:1: AIR301 `airflow.utils.trigger_rule.TriggerRule.NONE_FAILED_OR_SKIPPED` is removed in Airflow 3.0
|
||||
|
|
||||
96 | # airflow.utils.trigger_rule
|
||||
97 | TriggerRule.DUMMY
|
||||
98 | TriggerRule.NONE_FAILED_OR_SKIPPED
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
|
|
||||
|
||||
AIR301_names.py:102:1: AIR301 `airflow.www.auth.has_access` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.state.terminating_states` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:98:1
|
||||
|
|
||||
101 | # airflow.www.auth
|
||||
102 | has_access
|
||||
| ^^^^^^^^^^ AIR301
|
||||
103 | has_access_dataset
|
||||
96 | # airflow.utils.state
|
||||
97 | SHUTDOWN
|
||||
98 | terminating_states
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
99 |
|
||||
100 | # airflow.utils.trigger_rule
|
||||
|
|
||||
|
||||
AIR301_names.py:103:1: AIR301 `airflow.www.auth.has_access_dataset` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.trigger_rule.TriggerRule.DUMMY` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:101:1
|
||||
|
|
||||
101 | # airflow.www.auth
|
||||
102 | has_access
|
||||
103 | has_access_dataset
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
104 |
|
||||
105 | # airflow.www.utils
|
||||
100 | # airflow.utils.trigger_rule
|
||||
101 | TriggerRule.DUMMY
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
102 | TriggerRule.NONE_FAILED_OR_SKIPPED
|
||||
|
|
||||
|
||||
AIR301_names.py:106:1: AIR301 `airflow.www.utils.get_sensitive_variables_fields` is removed in Airflow 3.0
|
||||
AIR301 `airflow.utils.trigger_rule.TriggerRule.NONE_FAILED_OR_SKIPPED` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:102:1
|
||||
|
|
||||
105 | # airflow.www.utils
|
||||
106 | get_sensitive_variables_fields
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
107 | should_hide_value_for_key
|
||||
100 | # airflow.utils.trigger_rule
|
||||
101 | TriggerRule.DUMMY
|
||||
102 | TriggerRule.NONE_FAILED_OR_SKIPPED
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
AIR301_names.py:107:1: AIR301 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0
|
||||
AIR301 `airflow.www.auth.has_access` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:106:1
|
||||
|
|
||||
105 | # airflow.www.utils
|
||||
106 | get_sensitive_variables_fields
|
||||
107 | should_hide_value_for_key
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
105 | # airflow.www.auth
|
||||
106 | has_access
|
||||
| ^^^^^^^^^^
|
||||
107 | has_access_dataset
|
||||
|
|
||||
|
||||
AIR301 `airflow.www.auth.has_access_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:107:1
|
||||
|
|
||||
105 | # airflow.www.auth
|
||||
106 | has_access
|
||||
107 | has_access_dataset
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
108 |
|
||||
109 | # airflow.www.utils
|
||||
|
|
||||
|
||||
AIR301 `airflow.www.utils.get_sensitive_variables_fields` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:110:1
|
||||
|
|
||||
109 | # airflow.www.utils
|
||||
110 | get_sensitive_variables_fields
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
111 | should_hide_value_for_key
|
||||
|
|
||||
|
||||
AIR301 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0
|
||||
--> AIR301_names.py:111:1
|
||||
|
|
||||
109 | # airflow.www.utils
|
||||
110 | get_sensitive_variables_fields
|
||||
111 | should_hide_value_for_key
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR301_names_fix.py:17:1: AIR301 [*] `airflow.api_connexion.security.requires_access_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.api_connexion.security.requires_access_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:17:1
|
||||
|
|
||||
15 | from airflow.security.permissions import RESOURCE_DATASET
|
||||
16 |
|
||||
17 | requires_access_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
18 |
|
||||
19 | DatasetDetails()
|
||||
|
|
||||
= help: Use `requires_access_asset` from `airflow.api_fastapi.core_api.security` instead.
|
||||
help: Use `requires_access_asset` from `airflow.api_fastapi.core_api.security` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
|
||||
@@ -24,16 +25,17 @@ AIR301_names_fix.py:17:1: AIR301 [*] `airflow.api_connexion.security.requires_ac
|
||||
19 20 | DatasetDetails()
|
||||
20 21 |
|
||||
|
||||
AIR301_names_fix.py:19:1: AIR301 [*] `airflow.auth.managers.models.resource_details.DatasetDetails` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.auth.managers.models.resource_details.DatasetDetails` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:19:1
|
||||
|
|
||||
17 | requires_access_dataset()
|
||||
18 |
|
||||
19 | DatasetDetails()
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
20 |
|
||||
21 | DatasetManager()
|
||||
|
|
||||
= help: Use `AssetDetails` from `airflow.api_fastapi.auth.managers.models.resource_details` instead.
|
||||
help: Use `AssetDetails` from `airflow.api_fastapi.auth.managers.models.resource_details` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
|
||||
@@ -49,16 +51,17 @@ AIR301_names_fix.py:19:1: AIR301 [*] `airflow.auth.managers.models.resource_deta
|
||||
21 22 | DatasetManager()
|
||||
22 23 | dataset_manager()
|
||||
|
||||
AIR301_names_fix.py:21:1: AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:21:1
|
||||
|
|
||||
19 | DatasetDetails()
|
||||
20 |
|
||||
21 | DatasetManager()
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
22 | dataset_manager()
|
||||
23 | resolve_dataset_manager()
|
||||
|
|
||||
= help: Use `AssetManager` from `airflow.assets.manager` instead.
|
||||
help: Use `AssetManager` from `airflow.assets.manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
|
||||
@@ -76,14 +79,15 @@ AIR301_names_fix.py:21:1: AIR301 [*] `airflow.datasets.manager.DatasetManager` i
|
||||
23 24 | resolve_dataset_manager()
|
||||
24 25 |
|
||||
|
||||
AIR301_names_fix.py:22:1: AIR301 [*] `airflow.datasets.manager.dataset_manager` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.datasets.manager.dataset_manager` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:22:1
|
||||
|
|
||||
21 | DatasetManager()
|
||||
22 | dataset_manager()
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^
|
||||
23 | resolve_dataset_manager()
|
||||
|
|
||||
= help: Use `asset_manager` from `airflow.assets.manager` instead.
|
||||
help: Use `asset_manager` from `airflow.assets.manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
|
||||
@@ -102,16 +106,17 @@ AIR301_names_fix.py:22:1: AIR301 [*] `airflow.datasets.manager.dataset_manager`
|
||||
24 25 |
|
||||
25 26 | DatasetLineageInfo()
|
||||
|
||||
AIR301_names_fix.py:23:1: AIR301 [*] `airflow.datasets.manager.resolve_dataset_manager` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.datasets.manager.resolve_dataset_manager` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:23:1
|
||||
|
|
||||
21 | DatasetManager()
|
||||
22 | dataset_manager()
|
||||
23 | resolve_dataset_manager()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
24 |
|
||||
25 | DatasetLineageInfo()
|
||||
|
|
||||
= help: Use `resolve_asset_manager` from `airflow.assets.manager` instead.
|
||||
help: Use `resolve_asset_manager` from `airflow.assets.manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
13 13 | from airflow.metrics.validators import AllowListValidator, BlockListValidator
|
||||
@@ -131,16 +136,17 @@ AIR301_names_fix.py:23:1: AIR301 [*] `airflow.datasets.manager.resolve_dataset_m
|
||||
25 26 | DatasetLineageInfo()
|
||||
26 27 |
|
||||
|
||||
AIR301_names_fix.py:25:1: AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:25:1
|
||||
|
|
||||
23 | resolve_dataset_manager()
|
||||
24 |
|
||||
25 | DatasetLineageInfo()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
26 |
|
||||
27 | AllowListValidator()
|
||||
|
|
||||
= help: Use `AssetLineageInfo` from `airflow.lineage.hook` instead.
|
||||
help: Use `AssetLineageInfo` from `airflow.lineage.hook` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
9 9 | dataset_manager,
|
||||
@@ -161,15 +167,16 @@ AIR301_names_fix.py:25:1: AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` i
|
||||
27 27 | AllowListValidator()
|
||||
28 28 | BlockListValidator()
|
||||
|
||||
AIR301_names_fix.py:27:1: AIR301 [*] `airflow.metrics.validators.AllowListValidator` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.metrics.validators.AllowListValidator` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:27:1
|
||||
|
|
||||
25 | DatasetLineageInfo()
|
||||
26 |
|
||||
27 | AllowListValidator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
28 | BlockListValidator()
|
||||
|
|
||||
= help: Use `PatternAllowListValidator` from `airflow.metrics.validators` instead.
|
||||
help: Use `PatternAllowListValidator` from `airflow.metrics.validators` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
10 10 | resolve_dataset_manager,
|
||||
@@ -190,15 +197,16 @@ AIR301_names_fix.py:27:1: AIR301 [*] `airflow.metrics.validators.AllowListValida
|
||||
29 29 |
|
||||
30 30 | load_connections()
|
||||
|
||||
AIR301_names_fix.py:28:1: AIR301 [*] `airflow.metrics.validators.BlockListValidator` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.metrics.validators.BlockListValidator` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:28:1
|
||||
|
|
||||
27 | AllowListValidator()
|
||||
28 | BlockListValidator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
29 |
|
||||
30 | load_connections()
|
||||
|
|
||||
= help: Use `PatternBlockListValidator` from `airflow.metrics.validators` instead.
|
||||
help: Use `PatternBlockListValidator` from `airflow.metrics.validators` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
10 10 | resolve_dataset_manager,
|
||||
@@ -219,16 +227,17 @@ AIR301_names_fix.py:28:1: AIR301 [*] `airflow.metrics.validators.BlockListValida
|
||||
30 30 | load_connections()
|
||||
31 31 |
|
||||
|
||||
AIR301_names_fix.py:30:1: AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:30:1
|
||||
|
|
||||
28 | BlockListValidator()
|
||||
29 |
|
||||
30 | load_connections()
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
31 |
|
||||
32 | RESOURCE_DATASET
|
||||
|
|
||||
= help: Use `load_connections_dict` from `airflow.secrets.local_filesystem` instead.
|
||||
help: Use `load_connections_dict` from `airflow.secrets.local_filesystem` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
11 11 | )
|
||||
@@ -249,14 +258,15 @@ AIR301_names_fix.py:30:1: AIR301 [*] `airflow.secrets.local_filesystem.load_conn
|
||||
32 32 | RESOURCE_DATASET
|
||||
33 33 |
|
||||
|
||||
AIR301_names_fix.py:32:1: AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:32:1
|
||||
|
|
||||
30 | load_connections()
|
||||
31 |
|
||||
32 | RESOURCE_DATASET
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead.
|
||||
help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
12 12 | from airflow.lineage.hook import DatasetLineageInfo
|
||||
@@ -277,15 +287,16 @@ AIR301_names_fix.py:32:1: AIR301 [*] `airflow.security.permissions.RESOURCE_DATA
|
||||
34 34 |
|
||||
35 35 | from airflow.listeners.spec.dataset import (
|
||||
|
||||
AIR301_names_fix.py:40:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_created` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_created` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:40:1
|
||||
|
|
||||
38 | )
|
||||
39 |
|
||||
40 | on_dataset_created()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
41 | on_dataset_changed()
|
||||
|
|
||||
= help: Use `on_asset_created` from `airflow.listeners.spec.asset` instead.
|
||||
help: Use `on_asset_created` from `airflow.listeners.spec.asset` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
36 36 | on_dataset_changed,
|
||||
@@ -299,13 +310,14 @@ AIR301_names_fix.py:40:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_
|
||||
42 43 |
|
||||
43 44 |
|
||||
|
||||
AIR301_names_fix.py:41:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_changed` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_changed` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:41:1
|
||||
|
|
||||
40 | on_dataset_created()
|
||||
41 | on_dataset_changed()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Use `on_asset_changed` from `airflow.listeners.spec.asset` instead.
|
||||
help: Use `on_asset_changed` from `airflow.listeners.spec.asset` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
36 36 | on_dataset_changed,
|
||||
@@ -320,16 +332,17 @@ AIR301_names_fix.py:41:1: AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_
|
||||
43 44 |
|
||||
44 45 | # airflow.operators.python
|
||||
|
||||
AIR301_names_fix.py:47:1: AIR301 [*] `airflow.operators.python.get_current_context` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.operators.python.get_current_context` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:47:1
|
||||
|
|
||||
45 | from airflow.operators.python import get_current_context
|
||||
46 |
|
||||
47 | get_current_context()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
48 |
|
||||
49 | # airflow.providers.mysql
|
||||
|
|
||||
= help: Use `get_current_context` from `airflow.sdk` instead.
|
||||
help: Use `get_current_context` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
42 42 |
|
||||
@@ -341,16 +354,17 @@ AIR301_names_fix.py:47:1: AIR301 [*] `airflow.operators.python.get_current_conte
|
||||
47 47 | get_current_context()
|
||||
48 48 |
|
||||
|
||||
AIR301_names_fix.py:52:1: AIR301 [*] `airflow.providers.mysql.datasets.mysql.sanitize_uri` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.mysql.datasets.mysql.sanitize_uri` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:52:1
|
||||
|
|
||||
50 | from airflow.providers.mysql.datasets.mysql import sanitize_uri
|
||||
51 |
|
||||
52 | sanitize_uri
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
53 |
|
||||
54 | # airflow.providers.postgres
|
||||
|
|
||||
= help: Use `sanitize_uri` from `airflow.providers.mysql.assets.mysql` instead.
|
||||
help: Use `sanitize_uri` from `airflow.providers.mysql.assets.mysql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
47 47 | get_current_context()
|
||||
@@ -362,16 +376,17 @@ AIR301_names_fix.py:52:1: AIR301 [*] `airflow.providers.mysql.datasets.mysql.san
|
||||
52 52 | sanitize_uri
|
||||
53 53 |
|
||||
|
||||
AIR301_names_fix.py:57:1: AIR301 [*] `airflow.providers.postgres.datasets.postgres.sanitize_uri` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.postgres.datasets.postgres.sanitize_uri` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:57:1
|
||||
|
|
||||
55 | from airflow.providers.postgres.datasets.postgres import sanitize_uri
|
||||
56 |
|
||||
57 | sanitize_uri
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
58 |
|
||||
59 | # airflow.providers.trino
|
||||
|
|
||||
= help: Use `sanitize_uri` from `airflow.providers.postgres.assets.postgres` instead.
|
||||
help: Use `sanitize_uri` from `airflow.providers.postgres.assets.postgres` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
52 52 | sanitize_uri
|
||||
@@ -383,16 +398,17 @@ AIR301_names_fix.py:57:1: AIR301 [*] `airflow.providers.postgres.datasets.postgr
|
||||
57 57 | sanitize_uri
|
||||
58 58 |
|
||||
|
||||
AIR301_names_fix.py:62:1: AIR301 [*] `airflow.providers.trino.datasets.trino.sanitize_uri` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.trino.datasets.trino.sanitize_uri` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:62:1
|
||||
|
|
||||
60 | from airflow.providers.trino.datasets.trino import sanitize_uri
|
||||
61 |
|
||||
62 | sanitize_uri
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
63 |
|
||||
64 | # airflow.notifications.basenotifier
|
||||
|
|
||||
= help: Use `sanitize_uri` from `airflow.providers.trino.assets.trino` instead.
|
||||
help: Use `sanitize_uri` from `airflow.providers.trino.assets.trino` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
57 57 | sanitize_uri
|
||||
@@ -404,16 +420,17 @@ AIR301_names_fix.py:62:1: AIR301 [*] `airflow.providers.trino.datasets.trino.san
|
||||
62 62 | sanitize_uri
|
||||
63 63 |
|
||||
|
||||
AIR301_names_fix.py:67:1: AIR301 [*] `airflow.notifications.basenotifier.BaseNotifier` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.notifications.basenotifier.BaseNotifier` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:67:1
|
||||
|
|
||||
65 | from airflow.notifications.basenotifier import BaseNotifier
|
||||
66 |
|
||||
67 | BaseNotifier()
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
68 |
|
||||
69 | # airflow.auth.manager
|
||||
|
|
||||
= help: Use `BaseNotifier` from `airflow.sdk.bases.notifier` instead.
|
||||
help: Use `BaseNotifier` from `airflow.sdk.bases.notifier` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
62 62 | sanitize_uri
|
||||
@@ -425,14 +442,15 @@ AIR301_names_fix.py:67:1: AIR301 [*] `airflow.notifications.basenotifier.BaseNot
|
||||
67 67 | BaseNotifier()
|
||||
68 68 |
|
||||
|
||||
AIR301_names_fix.py:72:1: AIR301 [*] `airflow.auth.managers.base_auth_manager.BaseAuthManager` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.auth.managers.base_auth_manager.BaseAuthManager` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:72:1
|
||||
|
|
||||
70 | from airflow.auth.managers.base_auth_manager import BaseAuthManager
|
||||
71 |
|
||||
72 | BaseAuthManager()
|
||||
| ^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Use `BaseAuthManager` from `airflow.api_fastapi.auth.managers.base_auth_manager` instead.
|
||||
help: Use `BaseAuthManager` from `airflow.api_fastapi.auth.managers.base_auth_manager` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
67 67 | BaseNotifier()
|
||||
@@ -444,14 +462,15 @@ AIR301_names_fix.py:72:1: AIR301 [*] `airflow.auth.managers.base_auth_manager.Ba
|
||||
72 72 | BaseAuthManager()
|
||||
73 73 |
|
||||
|
||||
AIR301_names_fix.py:87:1: AIR301 [*] `airflow.configuration.get` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.get` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:1
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^ AIR301
|
||||
| ^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.get` from `airflow.configuration` instead.
|
||||
help: Use `conf.get` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -467,14 +486,15 @@ AIR301_names_fix.py:87:1: AIR301 [*] `airflow.configuration.get` is removed in A
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:87:6: AIR301 [*] `airflow.configuration.getboolean` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.getboolean` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:6
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.getboolean` from `airflow.configuration` instead.
|
||||
help: Use `conf.getboolean` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -490,14 +510,15 @@ AIR301_names_fix.py:87:6: AIR301 [*] `airflow.configuration.getboolean` is remov
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:87:18: AIR301 [*] `airflow.configuration.getfloat` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.getfloat` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:18
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^^^^^^ AIR301
|
||||
| ^^^^^^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.getfloat` from `airflow.configuration` instead.
|
||||
help: Use `conf.getfloat` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -513,14 +534,15 @@ AIR301_names_fix.py:87:18: AIR301 [*] `airflow.configuration.getfloat` is remove
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:87:28: AIR301 [*] `airflow.configuration.getint` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.getint` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:28
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^^^^ AIR301
|
||||
| ^^^^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.getint` from `airflow.configuration` instead.
|
||||
help: Use `conf.getint` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -536,14 +558,15 @@ AIR301_names_fix.py:87:28: AIR301 [*] `airflow.configuration.getint` is removed
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:87:36: AIR301 [*] `airflow.configuration.has_option` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.has_option` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:36
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.has_option` from `airflow.configuration` instead.
|
||||
help: Use `conf.has_option` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -559,14 +582,15 @@ AIR301_names_fix.py:87:36: AIR301 [*] `airflow.configuration.has_option` is remo
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:87:48: AIR301 [*] `airflow.configuration.remove_option` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.remove_option` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:48
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.remove_option` from `airflow.configuration` instead.
|
||||
help: Use `conf.remove_option` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -582,14 +606,15 @@ AIR301_names_fix.py:87:48: AIR301 [*] `airflow.configuration.remove_option` is r
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:87:63: AIR301 [*] `airflow.configuration.as_dict` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.as_dict` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:63
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^^^^^ AIR301
|
||||
| ^^^^^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.as_dict` from `airflow.configuration` instead.
|
||||
help: Use `conf.as_dict` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -605,14 +630,15 @@ AIR301_names_fix.py:87:63: AIR301 [*] `airflow.configuration.as_dict` is removed
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:87:72: AIR301 [*] `airflow.configuration.set` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.configuration.set` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:87:72
|
||||
|
|
||||
86 | # airflow.configuration
|
||||
87 | get, getboolean, getfloat, getint, has_option, remove_option, as_dict, set
|
||||
| ^^^ AIR301
|
||||
| ^^^
|
||||
88 | from airflow.hooks.base_hook import BaseHook
|
||||
|
|
||||
= help: Use `conf.set` from `airflow.configuration` instead.
|
||||
help: Use `conf.set` from `airflow.configuration` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
81 81 | has_option,
|
||||
@@ -628,15 +654,16 @@ AIR301_names_fix.py:87:72: AIR301 [*] `airflow.configuration.set` is removed in
|
||||
89 90 |
|
||||
90 91 | # airflow.hooks
|
||||
|
||||
AIR301_names_fix.py:91:1: AIR301 [*] `airflow.hooks.base_hook.BaseHook` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.hooks.base_hook.BaseHook` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:91:1
|
||||
|
|
||||
90 | # airflow.hooks
|
||||
91 | BaseHook()
|
||||
| ^^^^^^^^ AIR301
|
||||
| ^^^^^^^^
|
||||
92 |
|
||||
93 | from airflow.sensors.base_sensor_operator import BaseSensorOperator
|
||||
|
|
||||
= help: Use `BaseHook` from `airflow.hooks.base` instead.
|
||||
help: Use `BaseHook` from `airflow.hooks.base` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
85 85 |
|
||||
@@ -648,14 +675,15 @@ AIR301_names_fix.py:91:1: AIR301 [*] `airflow.hooks.base_hook.BaseHook` is remov
|
||||
90 90 | # airflow.hooks
|
||||
91 91 | BaseHook()
|
||||
|
||||
AIR301_names_fix.py:96:1: AIR301 [*] `airflow.sensors.base_sensor_operator.BaseSensorOperator` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.sensors.base_sensor_operator.BaseSensorOperator` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:96:1
|
||||
|
|
||||
95 | # airflow.sensors.base_sensor_operator
|
||||
96 | BaseSensorOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
97 | BaseHook()
|
||||
|
|
||||
= help: Use `BaseSensorOperator` from `airflow.sdk.bases.sensor` instead.
|
||||
help: Use `BaseSensorOperator` from `airflow.sdk.bases.sensor` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
90 90 | # airflow.hooks
|
||||
@@ -667,16 +695,17 @@ AIR301_names_fix.py:96:1: AIR301 [*] `airflow.sensors.base_sensor_operator.BaseS
|
||||
95 95 | # airflow.sensors.base_sensor_operator
|
||||
96 96 | BaseSensorOperator()
|
||||
|
||||
AIR301_names_fix.py:97:1: AIR301 [*] `airflow.hooks.base_hook.BaseHook` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.hooks.base_hook.BaseHook` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:97:1
|
||||
|
|
||||
95 | # airflow.sensors.base_sensor_operator
|
||||
96 | BaseSensorOperator()
|
||||
97 | BaseHook()
|
||||
| ^^^^^^^^ AIR301
|
||||
| ^^^^^^^^
|
||||
98 |
|
||||
99 | from airflow.utils.helpers import chain as helper_chain
|
||||
|
|
||||
= help: Use `BaseHook` from `airflow.hooks.base` instead.
|
||||
help: Use `BaseHook` from `airflow.hooks.base` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
85 85 |
|
||||
@@ -693,14 +722,15 @@ AIR301_names_fix.py:97:1: AIR301 [*] `airflow.hooks.base_hook.BaseHook` is remov
|
||||
95 95 | # airflow.sensors.base_sensor_operator
|
||||
96 96 | BaseSensorOperator()
|
||||
|
||||
AIR301_names_fix.py:103:1: AIR301 [*] `airflow.utils.helpers.chain` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.utils.helpers.chain` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:103:1
|
||||
|
|
||||
102 | # airflow.utils.helpers
|
||||
103 | helper_chain
|
||||
| ^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^
|
||||
104 | helper_cross_downstream
|
||||
|
|
||||
= help: Use `chain` from `airflow.sdk` instead.
|
||||
help: Use `chain` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
98 98 |
|
||||
@@ -715,16 +745,17 @@ AIR301_names_fix.py:103:1: AIR301 [*] `airflow.utils.helpers.chain` is removed i
|
||||
105 106 |
|
||||
106 107 | # airflow.utils.file
|
||||
|
||||
AIR301_names_fix.py:104:1: AIR301 [*] `airflow.utils.helpers.cross_downstream` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.utils.helpers.cross_downstream` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:104:1
|
||||
|
|
||||
102 | # airflow.utils.helpers
|
||||
103 | helper_chain
|
||||
104 | helper_cross_downstream
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
105 |
|
||||
106 | # airflow.utils.file
|
||||
|
|
||||
= help: Use `cross_downstream` from `airflow.sdk` instead.
|
||||
help: Use `cross_downstream` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
98 98 |
|
||||
@@ -740,16 +771,17 @@ AIR301_names_fix.py:104:1: AIR301 [*] `airflow.utils.helpers.cross_downstream` i
|
||||
106 107 | # airflow.utils.file
|
||||
107 108 | from airflow.utils.file import TemporaryDirectory
|
||||
|
||||
AIR301_names_fix.py:109:1: AIR301 [*] `airflow.utils.file.TemporaryDirectory` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.utils.file.TemporaryDirectory` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:109:1
|
||||
|
|
||||
107 | from airflow.utils.file import TemporaryDirectory
|
||||
108 |
|
||||
109 | TemporaryDirectory()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
110 |
|
||||
111 | from airflow.utils.log import secrets_masker
|
||||
|
|
||||
= help: Use `TemporaryDirectory` from `tempfile` instead.
|
||||
help: Use `TemporaryDirectory` from `tempfile` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
104 104 | helper_cross_downstream
|
||||
@@ -761,13 +793,14 @@ AIR301_names_fix.py:109:1: AIR301 [*] `airflow.utils.file.TemporaryDirectory` is
|
||||
109 109 | TemporaryDirectory()
|
||||
110 110 |
|
||||
|
||||
AIR301_names_fix.py:114:1: AIR301 [*] `airflow.utils.log.secrets_masker` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.utils.log.secrets_masker` is removed in Airflow 3.0
|
||||
--> AIR301_names_fix.py:114:1
|
||||
|
|
||||
113 | # airflow.utils.log
|
||||
114 | secrets_masker
|
||||
| ^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Use `secrets_masker` from `airflow.sdk.execution_time` instead.
|
||||
help: Use `secrets_masker` from `airflow.sdk.execution_time` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
108 108 |
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR301_provider_names_fix.py:11:1: AIR301 [*] `airflow.providers.amazon.aws.auth_manager.avp.entities.AvpEntities.DATASET` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.amazon.aws.auth_manager.avp.entities.AvpEntities.DATASET` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:11:1
|
||||
|
|
||||
9 | from airflow.security.permissions import RESOURCE_DATASET
|
||||
10 |
|
||||
11 | AvpEntities.DATASET
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
12 |
|
||||
13 | # airflow.providers.openlineage.utils.utils
|
||||
|
|
||||
= help: Use `AvpEntities.ASSET` from `airflow.providers.amazon.aws.auth_manager.avp.entities` instead.
|
||||
help: Use `AvpEntities.ASSET` from `airflow.providers.amazon.aws.auth_manager.avp.entities` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
8 8 | from airflow.secrets.local_filesystem import load_connections
|
||||
@@ -22,14 +23,15 @@ AIR301_provider_names_fix.py:11:1: AIR301 [*] `airflow.providers.amazon.aws.auth
|
||||
13 13 | # airflow.providers.openlineage.utils.utils
|
||||
14 14 | DatasetInfo()
|
||||
|
||||
AIR301_provider_names_fix.py:14:1: AIR301 [*] `airflow.providers.openlineage.utils.utils.DatasetInfo` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.openlineage.utils.utils.DatasetInfo` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:14:1
|
||||
|
|
||||
13 | # airflow.providers.openlineage.utils.utils
|
||||
14 | DatasetInfo()
|
||||
| ^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^
|
||||
15 | translate_airflow_dataset()
|
||||
|
|
||||
= help: Use `AssetInfo` from `airflow.providers.openlineage.utils.utils` instead.
|
||||
help: Use `AssetInfo` from `airflow.providers.openlineage.utils.utils` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
4 4 | from airflow.providers.openlineage.utils.utils import (
|
||||
@@ -49,16 +51,17 @@ AIR301_provider_names_fix.py:14:1: AIR301 [*] `airflow.providers.openlineage.uti
|
||||
16 17 |
|
||||
17 18 | # airflow.secrets.local_filesystem
|
||||
|
||||
AIR301_provider_names_fix.py:15:1: AIR301 [*] `airflow.providers.openlineage.utils.utils.translate_airflow_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.openlineage.utils.utils.translate_airflow_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:15:1
|
||||
|
|
||||
13 | # airflow.providers.openlineage.utils.utils
|
||||
14 | DatasetInfo()
|
||||
15 | translate_airflow_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
16 |
|
||||
17 | # airflow.secrets.local_filesystem
|
||||
|
|
||||
= help: Use `translate_airflow_asset` from `airflow.providers.openlineage.utils.utils` instead.
|
||||
help: Use `translate_airflow_asset` from `airflow.providers.openlineage.utils.utils` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
4 4 | from airflow.providers.openlineage.utils.utils import (
|
||||
@@ -78,15 +81,16 @@ AIR301_provider_names_fix.py:15:1: AIR301 [*] `airflow.providers.openlineage.uti
|
||||
17 18 | # airflow.secrets.local_filesystem
|
||||
18 19 | load_connections()
|
||||
|
||||
AIR301_provider_names_fix.py:18:1: AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:18:1
|
||||
|
|
||||
17 | # airflow.secrets.local_filesystem
|
||||
18 | load_connections()
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
19 |
|
||||
20 | # airflow.security.permissions
|
||||
|
|
||||
= help: Use `load_connections_dict` from `airflow.secrets.local_filesystem` instead.
|
||||
help: Use `load_connections_dict` from `airflow.secrets.local_filesystem` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
5 5 | DatasetInfo,
|
||||
@@ -107,15 +111,16 @@ AIR301_provider_names_fix.py:18:1: AIR301 [*] `airflow.secrets.local_filesystem.
|
||||
20 20 | # airflow.security.permissions
|
||||
21 21 | RESOURCE_DATASET
|
||||
|
||||
AIR301_provider_names_fix.py:21:1: AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:21:1
|
||||
|
|
||||
20 | # airflow.security.permissions
|
||||
21 | RESOURCE_DATASET
|
||||
| ^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
22 |
|
||||
23 | from airflow.providers.amazon.aws.datasets.s3 import (
|
||||
|
|
||||
= help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead.
|
||||
help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
6 6 | translate_airflow_dataset,
|
||||
@@ -136,15 +141,16 @@ AIR301_provider_names_fix.py:21:1: AIR301 [*] `airflow.security.permissions.RESO
|
||||
23 23 | from airflow.providers.amazon.aws.datasets.s3 import (
|
||||
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
|
||||
|
||||
AIR301_provider_names_fix.py:28:1: AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.create_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.create_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:28:1
|
||||
|
|
||||
26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
|
||||
27 |
|
||||
28 | s3_create_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
29 | s3_convert_dataset_to_openlineage()
|
||||
|
|
||||
= help: Use `create_asset` from `airflow.providers.amazon.aws.assets.s3` instead.
|
||||
help: Use `create_asset` from `airflow.providers.amazon.aws.assets.s3` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
|
||||
@@ -158,15 +164,16 @@ AIR301_provider_names_fix.py:28:1: AIR301 [*] `airflow.providers.amazon.aws.data
|
||||
30 31 |
|
||||
31 32 | from airflow.providers.common.io.dataset.file import (
|
||||
|
||||
AIR301_provider_names_fix.py:29:1: AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:29:1
|
||||
|
|
||||
28 | s3_create_dataset()
|
||||
29 | s3_convert_dataset_to_openlineage()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
30 |
|
||||
31 | from airflow.providers.common.io.dataset.file import (
|
||||
|
|
||||
= help: Use `convert_asset_to_openlineage` from `airflow.providers.amazon.aws.assets.s3` instead.
|
||||
help: Use `convert_asset_to_openlineage` from `airflow.providers.amazon.aws.assets.s3` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
|
||||
@@ -181,16 +188,17 @@ AIR301_provider_names_fix.py:29:1: AIR301 [*] `airflow.providers.amazon.aws.data
|
||||
31 32 | from airflow.providers.common.io.dataset.file import (
|
||||
32 33 | convert_dataset_to_openlineage as io_convert_dataset_to_openlineage,
|
||||
|
||||
AIR301_provider_names_fix.py:45:1: AIR301 [*] `airflow.providers.google.datasets.bigquery.create_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.google.datasets.bigquery.create_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:45:1
|
||||
|
|
||||
43 | )
|
||||
44 |
|
||||
45 | bigquery_create_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
46 |
|
||||
47 | # airflow.providers.google.datasets.gcs
|
||||
|
|
||||
= help: Use `create_asset` from `airflow.providers.google.assets.bigquery` instead.
|
||||
help: Use `create_asset` from `airflow.providers.google.assets.bigquery` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
41 41 | from airflow.providers.google.datasets.bigquery import (
|
||||
@@ -204,15 +212,16 @@ AIR301_provider_names_fix.py:45:1: AIR301 [*] `airflow.providers.google.datasets
|
||||
47 48 | # airflow.providers.google.datasets.gcs
|
||||
48 49 | from airflow.providers.google.datasets.gcs import (
|
||||
|
||||
AIR301_provider_names_fix.py:53:1: AIR301 [*] `airflow.providers.google.datasets.gcs.create_dataset` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.google.datasets.gcs.create_dataset` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:53:1
|
||||
|
|
||||
51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
|
||||
52 |
|
||||
53 | gcs_create_dataset()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
54 | gcs_convert_dataset_to_openlineage()
|
||||
|
|
||||
= help: Use `create_asset` from `airflow.providers.google.assets.gcs` instead.
|
||||
help: Use `create_asset` from `airflow.providers.google.assets.gcs` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
49 49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
|
||||
@@ -224,13 +233,14 @@ AIR301_provider_names_fix.py:53:1: AIR301 [*] `airflow.providers.google.datasets
|
||||
54 |+create_asset()
|
||||
54 55 | gcs_convert_dataset_to_openlineage()
|
||||
|
||||
AIR301_provider_names_fix.py:54:1: AIR301 [*] `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
||||
AIR301 [*] `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage` is removed in Airflow 3.0
|
||||
--> AIR301_provider_names_fix.py:54:1
|
||||
|
|
||||
53 | gcs_create_dataset()
|
||||
54 | gcs_convert_dataset_to_openlineage()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR301
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Use `convert_asset_to_openlineage` from `airflow.providers.google.assets.gcs` instead.
|
||||
help: Use `convert_asset_to_openlineage` from `airflow.providers.google.assets.gcs` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
49 49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_amazon.py:14:1: AIR302 [*] `airflow.hooks.S3_hook.S3Hook` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.S3_hook.S3Hook` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:14:1
|
||||
|
|
||||
12 | from airflow.sensors.s3_key_sensor import S3KeySensor
|
||||
13 |
|
||||
14 | S3Hook()
|
||||
| ^^^^^^ AIR302
|
||||
| ^^^^^^
|
||||
15 | provide_bucket_name()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3Hook` from `airflow.providers.amazon.aws.hooks.s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3Hook` from `airflow.providers.amazon.aws.hooks.s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -28,15 +29,16 @@ AIR302_amazon.py:14:1: AIR302 [*] `airflow.hooks.S3_hook.S3Hook` is moved into `
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:15:1: AIR302 [*] `airflow.hooks.S3_hook.provide_bucket_name` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.S3_hook.provide_bucket_name` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:15:1
|
||||
|
|
||||
14 | S3Hook()
|
||||
15 | provide_bucket_name()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
16 |
|
||||
17 | GCSToS3Operator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `provide_bucket_name` from `airflow.providers.amazon.aws.hooks.s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `provide_bucket_name` from `airflow.providers.amazon.aws.hooks.s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -55,16 +57,17 @@ AIR302_amazon.py:15:1: AIR302 [*] `airflow.hooks.S3_hook.provide_bucket_name` is
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:17:1: AIR302 [*] `airflow.operators.gcs_to_s3.GCSToS3Operator` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.gcs_to_s3.GCSToS3Operator` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:17:1
|
||||
|
|
||||
15 | provide_bucket_name()
|
||||
16 |
|
||||
17 | GCSToS3Operator()
|
||||
| ^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^
|
||||
18 | GoogleApiToS3Operator()
|
||||
19 | RedshiftToS3Operator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `GCSToS3Operator` from `airflow.providers.amazon.aws.transfers.gcs_to_s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `GCSToS3Operator` from `airflow.providers.amazon.aws.transfers.gcs_to_s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
4 4 | S3Hook,
|
||||
@@ -81,15 +84,16 @@ AIR302_amazon.py:17:1: AIR302 [*] `airflow.operators.gcs_to_s3.GCSToS3Operator`
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:18:1: AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Operator` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Operator` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:18:1
|
||||
|
|
||||
17 | GCSToS3Operator()
|
||||
18 | GoogleApiToS3Operator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
19 | RedshiftToS3Operator()
|
||||
20 | S3FileTransformOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `GoogleApiToS3Operator` from `airflow.providers.amazon.aws.transfers.google_api_to_s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `GoogleApiToS3Operator` from `airflow.providers.amazon.aws.transfers.google_api_to_s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
5 5 | provide_bucket_name,
|
||||
@@ -105,16 +109,17 @@ AIR302_amazon.py:18:1: AIR302 [*] `airflow.operators.google_api_to_s3_transfer.G
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:19:1: AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Operator` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Operator` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:19:1
|
||||
|
|
||||
17 | GCSToS3Operator()
|
||||
18 | GoogleApiToS3Operator()
|
||||
19 | RedshiftToS3Operator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
20 | S3FileTransformOperator()
|
||||
21 | S3ToRedshiftOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `RedshiftToS3Operator` from `airflow.providers.amazon.aws.transfers.redshift_to_s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `RedshiftToS3Operator` from `airflow.providers.amazon.aws.transfers.redshift_to_s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
6 6 | )
|
||||
@@ -129,16 +134,17 @@ AIR302_amazon.py:19:1: AIR302 [*] `airflow.operators.redshift_to_s3_operator.Red
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:20:1: AIR302 [*] `airflow.operators.s3_file_transform_operator.S3FileTransformOperator` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.s3_file_transform_operator.S3FileTransformOperator` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:20:1
|
||||
|
|
||||
18 | GoogleApiToS3Operator()
|
||||
19 | RedshiftToS3Operator()
|
||||
20 | S3FileTransformOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
21 | S3ToRedshiftOperator()
|
||||
22 | S3KeySensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=3.0.0` and use `S3FileTransformOperator` from `airflow.providers.amazon.aws.operators.s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=3.0.0` and use `S3FileTransformOperator` from `airflow.providers.amazon.aws.operators.s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
7 7 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
|
||||
@@ -152,15 +158,16 @@ AIR302_amazon.py:20:1: AIR302 [*] `airflow.operators.s3_file_transform_operator.
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:21:1: AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftOperator` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftOperator` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:21:1
|
||||
|
|
||||
19 | RedshiftToS3Operator()
|
||||
20 | S3FileTransformOperator()
|
||||
21 | S3ToRedshiftOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
22 | S3KeySensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3ToRedshiftOperator` from `airflow.providers.amazon.aws.transfers.s3_to_redshift` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3ToRedshiftOperator` from `airflow.providers.amazon.aws.transfers.s3_to_redshift` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
8 8 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
|
||||
@@ -173,16 +180,17 @@ AIR302_amazon.py:21:1: AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3T
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:22:1: AIR302 [*] `airflow.sensors.s3_key_sensor.S3KeySensor` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.s3_key_sensor.S3KeySensor` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:22:1
|
||||
|
|
||||
20 | S3FileTransformOperator()
|
||||
21 | S3ToRedshiftOperator()
|
||||
22 | S3KeySensor()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
23 |
|
||||
24 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Transfer
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3KeySensor` from `airflow.providers.amazon.aws.sensors.s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3KeySensor` from `airflow.providers.amazon.aws.sensors.s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
9 9 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
|
||||
@@ -194,16 +202,17 @@ AIR302_amazon.py:22:1: AIR302 [*] `airflow.sensors.s3_key_sensor.S3KeySensor` is
|
||||
14 14 | S3Hook()
|
||||
15 15 | provide_bucket_name()
|
||||
|
||||
AIR302_amazon.py:26:1: AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Transfer` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Transfer` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:26:1
|
||||
|
|
||||
24 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Transfer
|
||||
25 |
|
||||
26 | GoogleApiToS3Transfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
27 |
|
||||
28 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Transfer
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `GoogleApiToS3Operator` from `airflow.providers.amazon.aws.transfers.google_api_to_s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `GoogleApiToS3Operator` from `airflow.providers.amazon.aws.transfers.google_api_to_s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
22 22 | S3KeySensor()
|
||||
@@ -214,16 +223,17 @@ AIR302_amazon.py:26:1: AIR302 [*] `airflow.operators.google_api_to_s3_transfer.G
|
||||
26 27 | GoogleApiToS3Transfer()
|
||||
27 28 |
|
||||
|
||||
AIR302_amazon.py:30:1: AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Transfer` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Transfer` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:30:1
|
||||
|
|
||||
28 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Transfer
|
||||
29 |
|
||||
30 | RedshiftToS3Transfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
31 |
|
||||
32 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftTransfer
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `RedshiftToS3Operator` from `airflow.providers.amazon.aws.transfers.redshift_to_s3` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `RedshiftToS3Operator` from `airflow.providers.amazon.aws.transfers.redshift_to_s3` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
26 26 | GoogleApiToS3Transfer()
|
||||
@@ -234,14 +244,15 @@ AIR302_amazon.py:30:1: AIR302 [*] `airflow.operators.redshift_to_s3_operator.Red
|
||||
30 31 | RedshiftToS3Transfer()
|
||||
31 32 |
|
||||
|
||||
AIR302_amazon.py:34:1: AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftTransfer` is moved into `amazon` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftTransfer` is moved into `amazon` provider in Airflow 3.0;
|
||||
--> AIR302_amazon.py:34:1
|
||||
|
|
||||
32 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftTransfer
|
||||
33 |
|
||||
34 | S3ToRedshiftTransfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3ToRedshiftOperator` from `airflow.providers.amazon.aws.transfers.s3_to_redshift` instead.
|
||||
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3ToRedshiftOperator` from `airflow.providers.amazon.aws.transfers.s3_to_redshift` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
30 30 | RedshiftToS3Transfer()
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_celery.py:9:1: AIR302 [*] `airflow.config_templates.default_celery.DEFAULT_CELERY_CONFIG` is moved into `celery` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.config_templates.default_celery.DEFAULT_CELERY_CONFIG` is moved into `celery` provider in Airflow 3.0;
|
||||
--> AIR302_celery.py:9:1
|
||||
|
|
||||
7 | )
|
||||
8 |
|
||||
9 | DEFAULT_CELERY_CONFIG
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
10 |
|
||||
11 | app
|
||||
|
|
||||
= help: Install `apache-airflow-providers-celery>=3.3.0` and use `DEFAULT_CELERY_CONFIG` from `airflow.providers.celery.executors.default_celery` instead.
|
||||
help: Install `apache-airflow-providers-celery>=3.3.0` and use `DEFAULT_CELERY_CONFIG` from `airflow.providers.celery.executors.default_celery` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -25,15 +26,16 @@ AIR302_celery.py:9:1: AIR302 [*] `airflow.config_templates.default_celery.DEFAUL
|
||||
9 9 | DEFAULT_CELERY_CONFIG
|
||||
10 10 |
|
||||
|
||||
AIR302_celery.py:11:1: AIR302 [*] `airflow.executors.celery_executor.app` is moved into `celery` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.executors.celery_executor.app` is moved into `celery` provider in Airflow 3.0;
|
||||
--> AIR302_celery.py:11:1
|
||||
|
|
||||
9 | DEFAULT_CELERY_CONFIG
|
||||
10 |
|
||||
11 | app
|
||||
| ^^^ AIR302
|
||||
| ^^^
|
||||
12 | CeleryExecutor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-celery>=3.3.0` and use `app` from `airflow.providers.celery.executors.celery_executor_utils` instead.
|
||||
help: Install `apache-airflow-providers-celery>=3.3.0` and use `app` from `airflow.providers.celery.executors.celery_executor_utils` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
3 3 | from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
|
||||
@@ -46,13 +48,14 @@ AIR302_celery.py:11:1: AIR302 [*] `airflow.executors.celery_executor.app` is mov
|
||||
9 9 | DEFAULT_CELERY_CONFIG
|
||||
10 10 |
|
||||
|
||||
AIR302_celery.py:12:1: AIR302 [*] `airflow.executors.celery_executor.CeleryExecutor` is moved into `celery` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.executors.celery_executor.CeleryExecutor` is moved into `celery` provider in Airflow 3.0;
|
||||
--> AIR302_celery.py:12:1
|
||||
|
|
||||
11 | app
|
||||
12 | CeleryExecutor()
|
||||
| ^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-celery>=3.3.0` and use `CeleryExecutor` from `airflow.providers.celery.executors.celery_executor` instead.
|
||||
help: Install `apache-airflow-providers-celery>=3.3.0` and use `CeleryExecutor` from `airflow.providers.celery.executors.celery_executor` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_common_sql.py:8:1: AIR302 [*] `airflow.hooks.dbapi.ConnectorProtocol` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.dbapi.ConnectorProtocol` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:8:1
|
||||
|
|
||||
6 | )
|
||||
7 |
|
||||
8 | ConnectorProtocol()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
9 | DbApiHook()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `ConnectorProtocol` from `airflow.providers.common.sql.hooks.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `ConnectorProtocol` from `airflow.providers.common.sql.hooks.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -23,15 +24,16 @@ AIR302_common_sql.py:8:1: AIR302 [*] `airflow.hooks.dbapi.ConnectorProtocol` is
|
||||
8 8 | ConnectorProtocol()
|
||||
9 9 | DbApiHook()
|
||||
|
||||
AIR302_common_sql.py:9:1: AIR302 [*] `airflow.hooks.dbapi.DbApiHook` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.dbapi.DbApiHook` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:9:1
|
||||
|
|
||||
8 | ConnectorProtocol()
|
||||
9 | DbApiHook()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
10 |
|
||||
11 | from airflow.hooks.dbapi_hook import DbApiHook
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `DbApiHook` from `airflow.providers.common.sql.hooks.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `DbApiHook` from `airflow.providers.common.sql.hooks.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -44,15 +46,16 @@ AIR302_common_sql.py:9:1: AIR302 [*] `airflow.hooks.dbapi.DbApiHook` is moved in
|
||||
8 8 | ConnectorProtocol()
|
||||
9 9 | DbApiHook()
|
||||
|
||||
AIR302_common_sql.py:14:1: AIR302 [*] `airflow.hooks.dbapi_hook.DbApiHook` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.dbapi_hook.DbApiHook` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:14:1
|
||||
|
|
||||
12 | from airflow.operators.check_operator import SQLCheckOperator
|
||||
13 |
|
||||
14 | DbApiHook()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
15 | SQLCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `DbApiHook` from `airflow.providers.common.sql.hooks.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `DbApiHook` from `airflow.providers.common.sql.hooks.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
8 8 | ConnectorProtocol()
|
||||
@@ -65,13 +68,14 @@ AIR302_common_sql.py:14:1: AIR302 [*] `airflow.hooks.dbapi_hook.DbApiHook` is mo
|
||||
14 14 | DbApiHook()
|
||||
15 15 | SQLCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:15:1: AIR302 [*] `airflow.operators.check_operator.SQLCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.SQLCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:15:1
|
||||
|
|
||||
14 | DbApiHook()
|
||||
15 | SQLCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
9 9 | DbApiHook()
|
||||
@@ -83,15 +87,16 @@ AIR302_common_sql.py:15:1: AIR302 [*] `airflow.operators.check_operator.SQLCheck
|
||||
14 14 | DbApiHook()
|
||||
15 15 | SQLCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:21:1: AIR302 [*] `airflow.operators.sql.SQLCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.SQLCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:21:1
|
||||
|
|
||||
19 | from airflow.operators.sql import SQLCheckOperator
|
||||
20 |
|
||||
21 | SQLCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
22 | CheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
16 16 |
|
||||
@@ -103,13 +108,14 @@ AIR302_common_sql.py:21:1: AIR302 [*] `airflow.operators.sql.SQLCheckOperator` i
|
||||
21 21 | SQLCheckOperator()
|
||||
22 22 | CheckOperator()
|
||||
|
||||
AIR302_common_sql.py:22:1: AIR302 [*] `airflow.operators.check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:22:1
|
||||
|
|
||||
21 | SQLCheckOperator()
|
||||
22 | CheckOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
17 17 |
|
||||
@@ -120,14 +126,15 @@ AIR302_common_sql.py:22:1: AIR302 [*] `airflow.operators.check_operator.CheckOpe
|
||||
21 22 | SQLCheckOperator()
|
||||
22 23 | CheckOperator()
|
||||
|
||||
AIR302_common_sql.py:27:1: AIR302 [*] `airflow.operators.druid_check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.druid_check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:27:1
|
||||
|
|
||||
25 | from airflow.operators.druid_check_operator import CheckOperator
|
||||
26 |
|
||||
27 | CheckOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
23 23 |
|
||||
@@ -138,14 +145,15 @@ AIR302_common_sql.py:27:1: AIR302 [*] `airflow.operators.druid_check_operator.Ch
|
||||
27 28 | CheckOperator()
|
||||
28 29 |
|
||||
|
||||
AIR302_common_sql.py:32:1: AIR302 [*] `airflow.operators.presto_check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:32:1
|
||||
|
|
||||
30 | from airflow.operators.presto_check_operator import CheckOperator
|
||||
31 |
|
||||
32 | CheckOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
28 28 |
|
||||
@@ -156,16 +164,17 @@ AIR302_common_sql.py:32:1: AIR302 [*] `airflow.operators.presto_check_operator.C
|
||||
32 33 | CheckOperator()
|
||||
33 34 |
|
||||
|
||||
AIR302_common_sql.py:42:1: AIR302 [*] `airflow.operators.druid_check_operator.DruidCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.druid_check_operator.DruidCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:42:1
|
||||
|
|
||||
40 | from airflow.operators.presto_check_operator import PrestoCheckOperator
|
||||
41 |
|
||||
42 | DruidCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
43 | PrestoCheckOperator()
|
||||
44 | IntervalCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
38 38 | )
|
||||
@@ -176,15 +185,16 @@ AIR302_common_sql.py:42:1: AIR302 [*] `airflow.operators.druid_check_operator.Dr
|
||||
42 43 | DruidCheckOperator()
|
||||
43 44 | PrestoCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:43:1: AIR302 [*] `airflow.operators.presto_check_operator.PrestoCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_check_operator.PrestoCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:43:1
|
||||
|
|
||||
42 | DruidCheckOperator()
|
||||
43 | PrestoCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
44 | IntervalCheckOperator()
|
||||
45 | SQLIntervalCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
38 38 | )
|
||||
@@ -195,15 +205,16 @@ AIR302_common_sql.py:43:1: AIR302 [*] `airflow.operators.presto_check_operator.P
|
||||
42 43 | DruidCheckOperator()
|
||||
43 44 | PrestoCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:44:1: AIR302 [*] `airflow.operators.check_operator.IntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.IntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:44:1
|
||||
|
|
||||
42 | DruidCheckOperator()
|
||||
43 | PrestoCheckOperator()
|
||||
44 | IntervalCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
45 | SQLIntervalCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
34 34 |
|
||||
@@ -218,14 +229,15 @@ AIR302_common_sql.py:44:1: AIR302 [*] `airflow.operators.check_operator.Interval
|
||||
42 42 | DruidCheckOperator()
|
||||
43 43 | PrestoCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:45:1: AIR302 [*] `airflow.operators.check_operator.SQLIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.SQLIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:45:1
|
||||
|
|
||||
43 | PrestoCheckOperator()
|
||||
44 | IntervalCheckOperator()
|
||||
45 | SQLIntervalCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
34 34 |
|
||||
@@ -240,16 +252,17 @@ AIR302_common_sql.py:45:1: AIR302 [*] `airflow.operators.check_operator.SQLInter
|
||||
42 42 | DruidCheckOperator()
|
||||
43 43 | PrestoCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:54:1: AIR302 [*] `airflow.operators.presto_check_operator.IntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_check_operator.IntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:54:1
|
||||
|
|
||||
52 | from airflow.operators.sql import SQLIntervalCheckOperator
|
||||
53 |
|
||||
54 | IntervalCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
55 | SQLIntervalCheckOperator()
|
||||
56 | PrestoIntervalCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
50 50 | PrestoIntervalCheckOperator,
|
||||
@@ -260,14 +273,15 @@ AIR302_common_sql.py:54:1: AIR302 [*] `airflow.operators.presto_check_operator.I
|
||||
54 55 | IntervalCheckOperator()
|
||||
55 56 | SQLIntervalCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:55:1: AIR302 [*] `airflow.operators.sql.SQLIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.SQLIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:55:1
|
||||
|
|
||||
54 | IntervalCheckOperator()
|
||||
55 | SQLIntervalCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
56 | PrestoIntervalCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
49 49 | IntervalCheckOperator,
|
||||
@@ -279,14 +293,15 @@ AIR302_common_sql.py:55:1: AIR302 [*] `airflow.operators.sql.SQLIntervalCheckOpe
|
||||
54 54 | IntervalCheckOperator()
|
||||
55 55 | SQLIntervalCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:56:1: AIR302 [*] `airflow.operators.presto_check_operator.PrestoIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_check_operator.PrestoIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:56:1
|
||||
|
|
||||
54 | IntervalCheckOperator()
|
||||
55 | SQLIntervalCheckOperator()
|
||||
56 | PrestoIntervalCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
50 50 | PrestoIntervalCheckOperator,
|
||||
@@ -297,15 +312,16 @@ AIR302_common_sql.py:56:1: AIR302 [*] `airflow.operators.presto_check_operator.P
|
||||
54 55 | IntervalCheckOperator()
|
||||
55 56 | SQLIntervalCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:64:1: AIR302 [*] `airflow.operators.check_operator.SQLThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.SQLThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:64:1
|
||||
|
|
||||
62 | )
|
||||
63 |
|
||||
64 | SQLThresholdCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
65 | ThresholdCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
57 57 |
|
||||
@@ -319,13 +335,14 @@ AIR302_common_sql.py:64:1: AIR302 [*] `airflow.operators.check_operator.SQLThres
|
||||
64 64 | SQLThresholdCheckOperator()
|
||||
65 65 | ThresholdCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:65:1: AIR302 [*] `airflow.operators.check_operator.ThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.ThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:65:1
|
||||
|
|
||||
64 | SQLThresholdCheckOperator()
|
||||
65 | ThresholdCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
57 57 |
|
||||
@@ -339,14 +356,15 @@ AIR302_common_sql.py:65:1: AIR302 [*] `airflow.operators.check_operator.Threshol
|
||||
64 64 | SQLThresholdCheckOperator()
|
||||
65 65 | ThresholdCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:70:1: AIR302 [*] `airflow.operators.sql.SQLThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.SQLThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:70:1
|
||||
|
|
||||
68 | from airflow.operators.sql import SQLThresholdCheckOperator
|
||||
69 |
|
||||
70 | SQLThresholdCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
65 65 | ThresholdCheckOperator()
|
||||
@@ -358,15 +376,16 @@ AIR302_common_sql.py:70:1: AIR302 [*] `airflow.operators.sql.SQLThresholdCheckOp
|
||||
70 70 | SQLThresholdCheckOperator()
|
||||
71 71 |
|
||||
|
||||
AIR302_common_sql.py:78:1: AIR302 [*] `airflow.operators.check_operator.SQLValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.SQLValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:78:1
|
||||
|
|
||||
76 | )
|
||||
77 |
|
||||
78 | SQLValueCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
79 | ValueCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
71 71 |
|
||||
@@ -380,13 +399,14 @@ AIR302_common_sql.py:78:1: AIR302 [*] `airflow.operators.check_operator.SQLValue
|
||||
78 78 | SQLValueCheckOperator()
|
||||
79 79 | ValueCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:79:1: AIR302 [*] `airflow.operators.check_operator.ValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.check_operator.ValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:79:1
|
||||
|
|
||||
78 | SQLValueCheckOperator()
|
||||
79 | ValueCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
71 71 |
|
||||
@@ -400,16 +420,17 @@ AIR302_common_sql.py:79:1: AIR302 [*] `airflow.operators.check_operator.ValueChe
|
||||
78 78 | SQLValueCheckOperator()
|
||||
79 79 | ValueCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:88:1: AIR302 [*] `airflow.operators.sql.SQLValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.SQLValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:88:1
|
||||
|
|
||||
86 | from airflow.operators.sql import SQLValueCheckOperator
|
||||
87 |
|
||||
88 | SQLValueCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
89 | ValueCheckOperator()
|
||||
90 | PrestoValueCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
83 83 | PrestoValueCheckOperator,
|
||||
@@ -421,14 +442,15 @@ AIR302_common_sql.py:88:1: AIR302 [*] `airflow.operators.sql.SQLValueCheckOperat
|
||||
88 88 | SQLValueCheckOperator()
|
||||
89 89 | ValueCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:89:1: AIR302 [*] `airflow.operators.presto_check_operator.ValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_check_operator.ValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:89:1
|
||||
|
|
||||
88 | SQLValueCheckOperator()
|
||||
89 | ValueCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
90 | PrestoValueCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
84 84 | ValueCheckOperator,
|
||||
@@ -439,14 +461,15 @@ AIR302_common_sql.py:89:1: AIR302 [*] `airflow.operators.presto_check_operator.V
|
||||
88 89 | SQLValueCheckOperator()
|
||||
89 90 | ValueCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:90:1: AIR302 [*] `airflow.operators.presto_check_operator.PrestoValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_check_operator.PrestoValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:90:1
|
||||
|
|
||||
88 | SQLValueCheckOperator()
|
||||
89 | ValueCheckOperator()
|
||||
90 | PrestoValueCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
84 84 | ValueCheckOperator,
|
||||
@@ -457,16 +480,17 @@ AIR302_common_sql.py:90:1: AIR302 [*] `airflow.operators.presto_check_operator.P
|
||||
88 89 | SQLValueCheckOperator()
|
||||
89 90 | ValueCheckOperator()
|
||||
|
||||
AIR302_common_sql.py:102:1: AIR302 [*] `airflow.operators.sql.BaseSQLOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.BaseSQLOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:102:1
|
||||
|
|
||||
100 | )
|
||||
101 |
|
||||
102 | BaseSQLOperator()
|
||||
| ^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^
|
||||
103 | BranchSQLOperator()
|
||||
104 | SQLTableCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `BaseSQLOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `BaseSQLOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
91 91 |
|
||||
@@ -484,15 +508,16 @@ AIR302_common_sql.py:102:1: AIR302 [*] `airflow.operators.sql.BaseSQLOperator` i
|
||||
102 102 | BaseSQLOperator()
|
||||
103 103 | BranchSQLOperator()
|
||||
|
||||
AIR302_common_sql.py:103:1: AIR302 [*] `airflow.operators.sql.BranchSQLOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.BranchSQLOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:103:1
|
||||
|
|
||||
102 | BaseSQLOperator()
|
||||
103 | BranchSQLOperator()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
104 | SQLTableCheckOperator()
|
||||
105 | SQLColumnCheckOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `BranchSQLOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `BranchSQLOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
92 92 |
|
||||
@@ -509,16 +534,17 @@ AIR302_common_sql.py:103:1: AIR302 [*] `airflow.operators.sql.BranchSQLOperator`
|
||||
102 102 | BaseSQLOperator()
|
||||
103 103 | BranchSQLOperator()
|
||||
|
||||
AIR302_common_sql.py:104:1: AIR302 [*] `airflow.operators.sql.SQLTableCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.SQLTableCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:104:1
|
||||
|
|
||||
102 | BaseSQLOperator()
|
||||
103 | BranchSQLOperator()
|
||||
104 | SQLTableCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
105 | SQLColumnCheckOperator()
|
||||
106 | _convert_to_float_if_possible()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLTableCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLTableCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
94 94 | BaseSQLOperator,
|
||||
@@ -533,16 +559,17 @@ AIR302_common_sql.py:104:1: AIR302 [*] `airflow.operators.sql.SQLTableCheckOpera
|
||||
102 102 | BaseSQLOperator()
|
||||
103 103 | BranchSQLOperator()
|
||||
|
||||
AIR302_common_sql.py:105:1: AIR302 [*] `airflow.operators.sql.SQLColumnCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.SQLColumnCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:105:1
|
||||
|
|
||||
103 | BranchSQLOperator()
|
||||
104 | SQLTableCheckOperator()
|
||||
105 | SQLColumnCheckOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
106 | _convert_to_float_if_possible()
|
||||
107 | parse_boolean()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SQLColumnCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SQLColumnCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
93 93 | from airflow.operators.sql import (
|
||||
@@ -558,15 +585,16 @@ AIR302_common_sql.py:105:1: AIR302 [*] `airflow.operators.sql.SQLColumnCheckOper
|
||||
102 102 | BaseSQLOperator()
|
||||
103 103 | BranchSQLOperator()
|
||||
|
||||
AIR302_common_sql.py:106:1: AIR302 [*] `airflow.operators.sql._convert_to_float_if_possible` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql._convert_to_float_if_possible` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:106:1
|
||||
|
|
||||
104 | SQLTableCheckOperator()
|
||||
105 | SQLColumnCheckOperator()
|
||||
106 | _convert_to_float_if_possible()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
107 | parse_boolean()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `_convert_to_float_if_possible` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `_convert_to_float_if_possible` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
95 95 | BranchSQLOperator,
|
||||
@@ -580,14 +608,15 @@ AIR302_common_sql.py:106:1: AIR302 [*] `airflow.operators.sql._convert_to_float_
|
||||
102 102 | BaseSQLOperator()
|
||||
103 103 | BranchSQLOperator()
|
||||
|
||||
AIR302_common_sql.py:107:1: AIR302 [*] `airflow.operators.sql.parse_boolean` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.sql.parse_boolean` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:107:1
|
||||
|
|
||||
105 | SQLColumnCheckOperator()
|
||||
106 | _convert_to_float_if_possible()
|
||||
107 | parse_boolean()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `parse_boolean` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `parse_boolean` from `airflow.providers.common.sql.operators.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
96 96 | SQLColumnCheckOperator,
|
||||
@@ -600,14 +629,15 @@ AIR302_common_sql.py:107:1: AIR302 [*] `airflow.operators.sql.parse_boolean` is
|
||||
102 102 | BaseSQLOperator()
|
||||
103 103 | BranchSQLOperator()
|
||||
|
||||
AIR302_common_sql.py:112:1: AIR302 [*] `airflow.sensors.sql.SqlSensor` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.sql.SqlSensor` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:112:1
|
||||
|
|
||||
110 | from airflow.sensors.sql import SqlSensor
|
||||
111 |
|
||||
112 | SqlSensor()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
107 107 | parse_boolean()
|
||||
@@ -619,14 +649,15 @@ AIR302_common_sql.py:112:1: AIR302 [*] `airflow.sensors.sql.SqlSensor` is moved
|
||||
112 112 | SqlSensor()
|
||||
113 113 |
|
||||
|
||||
AIR302_common_sql.py:117:1: AIR302 [*] `airflow.sensors.sql_sensor.SqlSensor` is moved into `common-sql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.sql_sensor.SqlSensor` is moved into `common-sql` provider in Airflow 3.0;
|
||||
--> AIR302_common_sql.py:117:1
|
||||
|
|
||||
115 | from airflow.sensors.sql_sensor import SqlSensor
|
||||
116 |
|
||||
117 | SqlSensor()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead.
|
||||
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
112 112 | SqlSensor()
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_daskexecutor.py:5:1: AIR302 [*] `airflow.executors.dask_executor.DaskExecutor` is moved into `daskexecutor` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.executors.dask_executor.DaskExecutor` is moved into `daskexecutor` provider in Airflow 3.0;
|
||||
--> AIR302_daskexecutor.py:5:1
|
||||
|
|
||||
3 | from airflow.executors.dask_executor import DaskExecutor
|
||||
4 |
|
||||
5 | DaskExecutor()
|
||||
| ^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-daskexecutor>=1.0.0` and use `DaskExecutor` from `airflow.providers.daskexecutor.executors.dask_executor` instead.
|
||||
help: Install `apache-airflow-providers-daskexecutor>=1.0.0` and use `DaskExecutor` from `airflow.providers.daskexecutor.executors.dask_executor` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_druid.py:12:1: AIR302 [*] `airflow.hooks.druid_hook.DruidDbApiHook` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.druid_hook.DruidDbApiHook` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
--> AIR302_druid.py:12:1
|
||||
|
|
||||
10 | )
|
||||
11 |
|
||||
12 | DruidDbApiHook()
|
||||
| ^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^
|
||||
13 | DruidHook()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `DruidDbApiHook` from `airflow.providers.apache.druid.hooks.druid` instead.
|
||||
help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `DruidDbApiHook` from `airflow.providers.apache.druid.hooks.druid` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -27,15 +28,16 @@ AIR302_druid.py:12:1: AIR302 [*] `airflow.hooks.druid_hook.DruidDbApiHook` is mo
|
||||
12 12 | DruidDbApiHook()
|
||||
13 13 | DruidHook()
|
||||
|
||||
AIR302_druid.py:13:1: AIR302 [*] `airflow.hooks.druid_hook.DruidHook` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.druid_hook.DruidHook` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
--> AIR302_druid.py:13:1
|
||||
|
|
||||
12 | DruidDbApiHook()
|
||||
13 | DruidHook()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
14 |
|
||||
15 | HiveToDruidOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `DruidHook` from `airflow.providers.apache.druid.hooks.druid` instead.
|
||||
help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `DruidHook` from `airflow.providers.apache.druid.hooks.druid` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -52,15 +54,16 @@ AIR302_druid.py:13:1: AIR302 [*] `airflow.hooks.druid_hook.DruidHook` is moved i
|
||||
12 12 | DruidDbApiHook()
|
||||
13 13 | DruidHook()
|
||||
|
||||
AIR302_druid.py:15:1: AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidOperator` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidOperator` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
--> AIR302_druid.py:15:1
|
||||
|
|
||||
13 | DruidHook()
|
||||
14 |
|
||||
15 | HiveToDruidOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
16 | HiveToDruidTransfer()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `HiveToDruidOperator` from `airflow.providers.apache.druid.transfers.hive_to_druid` instead.
|
||||
help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `HiveToDruidOperator` from `airflow.providers.apache.druid.transfers.hive_to_druid` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
5 5 | DruidHook,
|
||||
@@ -74,13 +77,14 @@ AIR302_druid.py:15:1: AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidOpe
|
||||
12 12 | DruidDbApiHook()
|
||||
13 13 | DruidHook()
|
||||
|
||||
AIR302_druid.py:16:1: AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidTransfer` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidTransfer` is moved into `apache-druid` provider in Airflow 3.0;
|
||||
--> AIR302_druid.py:16:1
|
||||
|
|
||||
15 | HiveToDruidOperator()
|
||||
16 | HiveToDruidTransfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `HiveToDruidOperator` from `airflow.providers.apache.druid.transfers.hive_to_druid` instead.
|
||||
help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `HiveToDruidOperator` from `airflow.providers.apache.druid.transfers.hive_to_druid` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
5 5 | DruidHook,
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_fab.py:10:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.CLIENT_AUTH` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.basic_auth.CLIENT_AUTH` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:10:1
|
||||
|
|
||||
8 | )
|
||||
9 |
|
||||
10 | CLIENT_AUTH
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
11 | init_app()
|
||||
12 | auth_current_user()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `CLIENT_AUTH` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `CLIENT_AUTH` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -26,15 +27,16 @@ AIR302_fab.py:10:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.CLIENT_AUTH`
|
||||
10 10 | CLIENT_AUTH
|
||||
11 11 | init_app()
|
||||
|
||||
AIR302_fab.py:11:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.init_app` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.basic_auth.init_app` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:11:1
|
||||
|
|
||||
10 | CLIENT_AUTH
|
||||
11 | init_app()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
12 | auth_current_user()
|
||||
13 | requires_authentication()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `init_app` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `init_app` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
3 3 | from airflow.api.auth.backend.basic_auth import (
|
||||
@@ -48,15 +50,16 @@ AIR302_fab.py:11:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.init_app` is
|
||||
10 10 | CLIENT_AUTH
|
||||
11 11 | init_app()
|
||||
|
||||
AIR302_fab.py:12:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.auth_current_user` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.basic_auth.auth_current_user` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:12:1
|
||||
|
|
||||
10 | CLIENT_AUTH
|
||||
11 | init_app()
|
||||
12 | auth_current_user()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
13 | requires_authentication()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `auth_current_user` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `auth_current_user` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -71,16 +74,17 @@ AIR302_fab.py:12:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.auth_current
|
||||
10 10 | CLIENT_AUTH
|
||||
11 11 | init_app()
|
||||
|
||||
AIR302_fab.py:13:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.basic_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:13:1
|
||||
|
|
||||
11 | init_app()
|
||||
12 | auth_current_user()
|
||||
13 | requires_authentication()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
14 |
|
||||
15 | from airflow.api.auth.backend.kerberos_auth import (
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `requires_authentication` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `requires_authentication` from `airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
4 4 | CLIENT_AUTH,
|
||||
@@ -93,16 +97,17 @@ AIR302_fab.py:13:1: AIR302 [*] `airflow.api.auth.backend.basic_auth.requires_aut
|
||||
10 10 | CLIENT_AUTH
|
||||
11 11 | init_app()
|
||||
|
||||
AIR302_fab.py:23:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.log` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.log` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:23:1
|
||||
|
|
||||
21 | )
|
||||
22 |
|
||||
23 | log()
|
||||
| ^^^ AIR302
|
||||
| ^^^
|
||||
24 | CLIENT_AUTH
|
||||
25 | find_user()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `log` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `log` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
16 16 | CLIENT_AUTH,
|
||||
@@ -116,15 +121,16 @@ AIR302_fab.py:23:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.log` is m
|
||||
23 23 | log()
|
||||
24 24 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:24:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.CLIENT_AUTH` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.CLIENT_AUTH` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:24:1
|
||||
|
|
||||
23 | log()
|
||||
24 | CLIENT_AUTH
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
25 | find_user()
|
||||
26 | init_app()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `CLIENT_AUTH` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `CLIENT_AUTH` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
13 13 | requires_authentication()
|
||||
@@ -141,16 +147,17 @@ AIR302_fab.py:24:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.CLIENT_AU
|
||||
23 23 | log()
|
||||
24 24 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:25:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.find_user` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.find_user` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:25:1
|
||||
|
|
||||
23 | log()
|
||||
24 | CLIENT_AUTH
|
||||
25 | find_user()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
26 | init_app()
|
||||
27 | requires_authentication()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `find_user` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `find_user` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
14 14 |
|
||||
@@ -166,15 +173,16 @@ AIR302_fab.py:25:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.find_user
|
||||
23 23 | log()
|
||||
24 24 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:26:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.init_app` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.init_app` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:26:1
|
||||
|
|
||||
24 | CLIENT_AUTH
|
||||
25 | find_user()
|
||||
26 | init_app()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
27 | requires_authentication()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `init_app` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `init_app` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
15 15 | from airflow.api.auth.backend.kerberos_auth import (
|
||||
@@ -189,16 +197,17 @@ AIR302_fab.py:26:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.init_app`
|
||||
23 23 | log()
|
||||
24 24 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:27:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:27:1
|
||||
|
|
||||
25 | find_user()
|
||||
26 | init_app()
|
||||
27 | requires_authentication()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
28 |
|
||||
29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `requires_authentication` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `requires_authentication` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
17 17 | find_user,
|
||||
@@ -211,16 +220,17 @@ AIR302_fab.py:27:1: AIR302 [*] `airflow.api.auth.backend.kerberos_auth.requires_
|
||||
23 23 | log()
|
||||
24 24 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:37:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.log` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.log` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:37:1
|
||||
|
|
||||
35 | )
|
||||
36 |
|
||||
37 | log()
|
||||
| ^^^ AIR302
|
||||
| ^^^
|
||||
38 | CLIENT_AUTH
|
||||
39 | find_user()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `log` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `log` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
30 30 | CLIENT_AUTH,
|
||||
@@ -234,15 +244,16 @@ AIR302_fab.py:37:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerbe
|
||||
37 37 | log()
|
||||
38 38 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:38:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.CLIENT_AUTH` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.CLIENT_AUTH` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:38:1
|
||||
|
|
||||
37 | log()
|
||||
38 | CLIENT_AUTH
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
39 | find_user()
|
||||
40 | init_app()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `CLIENT_AUTH` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `CLIENT_AUTH` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
27 27 | requires_authentication()
|
||||
@@ -259,16 +270,17 @@ AIR302_fab.py:38:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerbe
|
||||
37 37 | log()
|
||||
38 38 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:39:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.find_user` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.find_user` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:39:1
|
||||
|
|
||||
37 | log()
|
||||
38 | CLIENT_AUTH
|
||||
39 | find_user()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
40 | init_app()
|
||||
41 | requires_authentication()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `find_user` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `find_user` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
28 28 |
|
||||
@@ -284,15 +296,16 @@ AIR302_fab.py:39:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerbe
|
||||
37 37 | log()
|
||||
38 38 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:40:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.init_app` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.init_app` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:40:1
|
||||
|
|
||||
38 | CLIENT_AUTH
|
||||
39 | find_user()
|
||||
40 | init_app()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
41 | requires_authentication()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `init_app` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `init_app` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
29 29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
|
||||
@@ -307,16 +320,17 @@ AIR302_fab.py:40:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerbe
|
||||
37 37 | log()
|
||||
38 38 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:41:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:41:1
|
||||
|
|
||||
39 | find_user()
|
||||
40 | init_app()
|
||||
41 | requires_authentication()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
42 |
|
||||
43 | from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `requires_authentication` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `requires_authentication` from `airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
31 31 | find_user,
|
||||
@@ -329,16 +343,17 @@ AIR302_fab.py:41:1: AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerbe
|
||||
37 37 | log()
|
||||
38 38 | CLIENT_AUTH
|
||||
|
||||
AIR302_fab.py:49:1: AIR302 [*] `airflow.auth.managers.fab.fab_auth_manager.FabAuthManager` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.fab_auth_manager.FabAuthManager` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:49:1
|
||||
|
|
||||
47 | )
|
||||
48 |
|
||||
49 | FabAuthManager()
|
||||
| ^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^
|
||||
50 | MAX_NUM_DATABASE_USER_SESSIONS
|
||||
51 | FabAirflowSecurityManagerOverride()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAuthManager` from `airflow.providers.fab.auth_manager.fab_auth_manager` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAuthManager` from `airflow.providers.fab.auth_manager.fab_auth_manager` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
40 40 | init_app()
|
||||
@@ -354,14 +369,15 @@ AIR302_fab.py:49:1: AIR302 [*] `airflow.auth.managers.fab.fab_auth_manager.FabAu
|
||||
49 49 | FabAuthManager()
|
||||
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
|
||||
|
||||
AIR302_fab.py:50:1: AIR302 [*] `airflow.auth.managers.fab.security_manager.override.MAX_NUM_DATABASE_USER_SESSIONS` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.security_manager.override.MAX_NUM_DATABASE_USER_SESSIONS` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:50:1
|
||||
|
|
||||
49 | FabAuthManager()
|
||||
50 | MAX_NUM_DATABASE_USER_SESSIONS
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
51 | FabAirflowSecurityManagerOverride()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `MAX_NUM_DATABASE_USER_SESSIONS` from `airflow.providers.fab.auth_manager.security_manager.override` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `MAX_NUM_DATABASE_USER_SESSIONS` from `airflow.providers.fab.auth_manager.security_manager.override` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
42 42 |
|
||||
@@ -375,16 +391,17 @@ AIR302_fab.py:50:1: AIR302 [*] `airflow.auth.managers.fab.security_manager.overr
|
||||
49 49 | FabAuthManager()
|
||||
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
|
||||
|
||||
AIR302_fab.py:51:1: AIR302 [*] `airflow.auth.managers.fab.security_manager.override.FabAirflowSecurityManagerOverride` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.auth.managers.fab.security_manager.override.FabAirflowSecurityManagerOverride` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:51:1
|
||||
|
|
||||
49 | FabAuthManager()
|
||||
50 | MAX_NUM_DATABASE_USER_SESSIONS
|
||||
51 | FabAirflowSecurityManagerOverride()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
52 |
|
||||
53 | from airflow.www.security import FabAirflowSecurityManagerOverride
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAirflowSecurityManagerOverride` from `airflow.providers.fab.auth_manager.security_manager.override` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAirflowSecurityManagerOverride` from `airflow.providers.fab.auth_manager.security_manager.override` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
43 43 | from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
|
||||
@@ -397,14 +414,15 @@ AIR302_fab.py:51:1: AIR302 [*] `airflow.auth.managers.fab.security_manager.overr
|
||||
49 49 | FabAuthManager()
|
||||
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
|
||||
|
||||
AIR302_fab.py:55:1: AIR302 [*] `airflow.www.security.FabAirflowSecurityManagerOverride` is moved into `fab` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.www.security.FabAirflowSecurityManagerOverride` is moved into `fab` provider in Airflow 3.0;
|
||||
--> AIR302_fab.py:55:1
|
||||
|
|
||||
53 | from airflow.www.security import FabAirflowSecurityManagerOverride
|
||||
54 |
|
||||
55 | FabAirflowSecurityManagerOverride()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAirflowSecurityManagerOverride` from `airflow.providers.fab.auth_manager.security_manager.override` instead.
|
||||
help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAirflowSecurityManagerOverride` from `airflow.providers.fab.auth_manager.security_manager.override` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_hdfs.py:6:1: AIR302 [*] `airflow.hooks.webhdfs_hook.WebHDFSHook` is moved into `apache-hdfs` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.webhdfs_hook.WebHDFSHook` is moved into `apache-hdfs` provider in Airflow 3.0;
|
||||
--> AIR302_hdfs.py:6:1
|
||||
|
|
||||
4 | from airflow.sensors.web_hdfs_sensor import WebHdfsSensor
|
||||
5 |
|
||||
6 | WebHDFSHook()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
7 | WebHdfsSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hdfs>=1.0.0` and use `WebHDFSHook` from `airflow.providers.apache.hdfs.hooks.webhdfs` instead.
|
||||
help: Install `apache-airflow-providers-apache-hdfs>=1.0.0` and use `WebHDFSHook` from `airflow.providers.apache.hdfs.hooks.webhdfs` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -21,13 +22,14 @@ AIR302_hdfs.py:6:1: AIR302 [*] `airflow.hooks.webhdfs_hook.WebHDFSHook` is moved
|
||||
6 6 | WebHDFSHook()
|
||||
7 7 | WebHdfsSensor()
|
||||
|
||||
AIR302_hdfs.py:7:1: AIR302 [*] `airflow.sensors.web_hdfs_sensor.WebHdfsSensor` is moved into `apache-hdfs` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.web_hdfs_sensor.WebHdfsSensor` is moved into `apache-hdfs` provider in Airflow 3.0;
|
||||
--> AIR302_hdfs.py:7:1
|
||||
|
|
||||
6 | WebHDFSHook()
|
||||
7 | WebHdfsSensor()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hdfs>=1.0.0` and use `WebHdfsSensor` from `airflow.providers.apache.hdfs.sensors.web_hdfs` instead.
|
||||
help: Install `apache-airflow-providers-apache-hdfs>=1.0.0` and use `WebHdfsSensor` from `airflow.providers.apache.hdfs.sensors.web_hdfs` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_hive.py:18:1: AIR302 [*] `airflow.hooks.hive_hooks.HIVE_QUEUE_PRIORITIES` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.hive_hooks.HIVE_QUEUE_PRIORITIES` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:18:1
|
||||
|
|
||||
16 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
|
||||
17 |
|
||||
18 | HIVE_QUEUE_PRIORITIES
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
19 | HiveCliHook()
|
||||
20 | HiveMetastoreHook()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HIVE_QUEUE_PRIORITIES` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HIVE_QUEUE_PRIORITIES` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -29,15 +30,16 @@ AIR302_hive.py:18:1: AIR302 [*] `airflow.hooks.hive_hooks.HIVE_QUEUE_PRIORITIES`
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:19:1: AIR302 [*] `airflow.hooks.hive_hooks.HiveCliHook` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.hive_hooks.HiveCliHook` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:19:1
|
||||
|
|
||||
18 | HIVE_QUEUE_PRIORITIES
|
||||
19 | HiveCliHook()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
20 | HiveMetastoreHook()
|
||||
21 | HiveServer2Hook()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveCliHook` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveCliHook` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -56,15 +58,16 @@ AIR302_hive.py:19:1: AIR302 [*] `airflow.hooks.hive_hooks.HiveCliHook` is moved
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:20:1: AIR302 [*] `airflow.hooks.hive_hooks.HiveMetastoreHook` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.hive_hooks.HiveMetastoreHook` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:20:1
|
||||
|
|
||||
18 | HIVE_QUEUE_PRIORITIES
|
||||
19 | HiveCliHook()
|
||||
20 | HiveMetastoreHook()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
21 | HiveServer2Hook()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveMetastoreHook` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveMetastoreHook` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
3 3 | from airflow.hooks.hive_hooks import (
|
||||
@@ -83,16 +86,17 @@ AIR302_hive.py:20:1: AIR302 [*] `airflow.hooks.hive_hooks.HiveMetastoreHook` is
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:21:1: AIR302 [*] `airflow.hooks.hive_hooks.HiveServer2Hook` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.hive_hooks.HiveServer2Hook` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:21:1
|
||||
|
|
||||
19 | HiveCliHook()
|
||||
20 | HiveMetastoreHook()
|
||||
21 | HiveServer2Hook()
|
||||
| ^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^
|
||||
22 |
|
||||
23 | closest_ds_partition()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveServer2Hook` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveServer2Hook` from `airflow.providers.apache.hive.hooks.hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
4 4 | HIVE_QUEUE_PRIORITIES,
|
||||
@@ -111,15 +115,16 @@ AIR302_hive.py:21:1: AIR302 [*] `airflow.hooks.hive_hooks.HiveServer2Hook` is mo
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:23:1: AIR302 [*] `airflow.macros.hive.closest_ds_partition` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.macros.hive.closest_ds_partition` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:23:1
|
||||
|
|
||||
21 | HiveServer2Hook()
|
||||
22 |
|
||||
23 | closest_ds_partition()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
24 | max_partition()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=5.1.0` and use `closest_ds_partition` from `airflow.providers.apache.hive.macros.hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=5.1.0` and use `closest_ds_partition` from `airflow.providers.apache.hive.macros.hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
7 7 | HiveServer2Hook,
|
||||
@@ -137,15 +142,16 @@ AIR302_hive.py:23:1: AIR302 [*] `airflow.macros.hive.closest_ds_partition` is mo
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:24:1: AIR302 [*] `airflow.macros.hive.max_partition` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.macros.hive.max_partition` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:24:1
|
||||
|
|
||||
23 | closest_ds_partition()
|
||||
24 | max_partition()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
25 |
|
||||
26 | HiveOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=5.1.0` and use `max_partition` from `airflow.providers.apache.hive.macros.hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=5.1.0` and use `max_partition` from `airflow.providers.apache.hive.macros.hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
8 8 | )
|
||||
@@ -162,16 +168,17 @@ AIR302_hive.py:24:1: AIR302 [*] `airflow.macros.hive.max_partition` is moved int
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:26:1: AIR302 [*] `airflow.operators.hive_operator.HiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.hive_operator.HiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:26:1
|
||||
|
|
||||
24 | max_partition()
|
||||
25 |
|
||||
26 | HiveOperator()
|
||||
| ^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^
|
||||
27 | HiveStatsCollectionOperator()
|
||||
28 | HiveToMySqlOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveOperator` from `airflow.providers.apache.hive.operators.hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveOperator` from `airflow.providers.apache.hive.operators.hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
10 10 | closest_ds_partition,
|
||||
@@ -186,15 +193,16 @@ AIR302_hive.py:26:1: AIR302 [*] `airflow.operators.hive_operator.HiveOperator` i
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:27:1: AIR302 [*] `airflow.operators.hive_stats_operator.HiveStatsCollectionOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.hive_stats_operator.HiveStatsCollectionOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:27:1
|
||||
|
|
||||
26 | HiveOperator()
|
||||
27 | HiveStatsCollectionOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
28 | HiveToMySqlOperator()
|
||||
29 | HiveToSambaOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveStatsCollectionOperator` from `airflow.providers.apache.hive.operators.hive_stats` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveStatsCollectionOperator` from `airflow.providers.apache.hive.operators.hive_stats` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
11 11 | max_partition,
|
||||
@@ -208,15 +216,16 @@ AIR302_hive.py:27:1: AIR302 [*] `airflow.operators.hive_stats_operator.HiveStats
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:28:1: AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:28:1
|
||||
|
|
||||
26 | HiveOperator()
|
||||
27 | HiveStatsCollectionOperator()
|
||||
28 | HiveToMySqlOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
29 | HiveToSambaOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToMySqlOperator` from `airflow.providers.apache.hive.transfers.hive_to_mysql` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToMySqlOperator` from `airflow.providers.apache.hive.transfers.hive_to_mysql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | )
|
||||
@@ -229,14 +238,15 @@ AIR302_hive.py:28:1: AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlOper
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:29:1: AIR302 [*] `airflow.operators.hive_to_samba_operator.HiveToSambaOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.hive_to_samba_operator.HiveToSambaOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:29:1
|
||||
|
|
||||
27 | HiveStatsCollectionOperator()
|
||||
28 | HiveToMySqlOperator()
|
||||
29 | HiveToSambaOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToSambaOperator` from `airflow.providers.apache.hive.transfers.hive_to_samba` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToSambaOperator` from `airflow.providers.apache.hive.transfers.hive_to_samba` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
13 13 | from airflow.operators.hive_operator import HiveOperator
|
||||
@@ -248,16 +258,17 @@ AIR302_hive.py:29:1: AIR302 [*] `airflow.operators.hive_to_samba_operator.HiveTo
|
||||
18 18 | HIVE_QUEUE_PRIORITIES
|
||||
19 19 | HiveCliHook()
|
||||
|
||||
AIR302_hive.py:34:1: AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:34:1
|
||||
|
|
||||
32 | from airflow.operators.hive_to_mysql import HiveToMySqlTransfer
|
||||
33 |
|
||||
34 | HiveToMySqlTransfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
35 |
|
||||
36 | from airflow.operators.mysql_to_hive import MySqlToHiveOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToMySqlOperator` from `airflow.providers.apache.hive.transfers.hive_to_mysql` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToMySqlOperator` from `airflow.providers.apache.hive.transfers.hive_to_mysql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
30 30 |
|
||||
@@ -268,16 +279,17 @@ AIR302_hive.py:34:1: AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlTran
|
||||
34 35 | HiveToMySqlTransfer()
|
||||
35 36 |
|
||||
|
||||
AIR302_hive.py:38:1: AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:38:1
|
||||
|
|
||||
36 | from airflow.operators.mysql_to_hive import MySqlToHiveOperator
|
||||
37 |
|
||||
38 | MySqlToHiveOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
39 |
|
||||
40 | from airflow.operators.mysql_to_hive import MySqlToHiveTransfer
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MySqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mysql_to_hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MySqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mysql_to_hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
33 33 |
|
||||
@@ -289,16 +301,17 @@ AIR302_hive.py:38:1: AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveOper
|
||||
38 38 | MySqlToHiveOperator()
|
||||
39 39 |
|
||||
|
||||
AIR302_hive.py:42:1: AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:42:1
|
||||
|
|
||||
40 | from airflow.operators.mysql_to_hive import MySqlToHiveTransfer
|
||||
41 |
|
||||
42 | MySqlToHiveTransfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
43 |
|
||||
44 | from airflow.operators.mssql_to_hive import MsSqlToHiveOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MySqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mysql_to_hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MySqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mysql_to_hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
38 38 | MySqlToHiveOperator()
|
||||
@@ -309,16 +322,17 @@ AIR302_hive.py:42:1: AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveTran
|
||||
42 43 | MySqlToHiveTransfer()
|
||||
43 44 |
|
||||
|
||||
AIR302_hive.py:46:1: AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:46:1
|
||||
|
|
||||
44 | from airflow.operators.mssql_to_hive import MsSqlToHiveOperator
|
||||
45 |
|
||||
46 | MsSqlToHiveOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
47 |
|
||||
48 | from airflow.operators.mssql_to_hive import MsSqlToHiveTransfer
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MsSqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mssql_to_hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MsSqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mssql_to_hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
41 41 |
|
||||
@@ -330,16 +344,17 @@ AIR302_hive.py:46:1: AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveOper
|
||||
46 46 | MsSqlToHiveOperator()
|
||||
47 47 |
|
||||
|
||||
AIR302_hive.py:50:1: AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:50:1
|
||||
|
|
||||
48 | from airflow.operators.mssql_to_hive import MsSqlToHiveTransfer
|
||||
49 |
|
||||
50 | MsSqlToHiveTransfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
51 |
|
||||
52 | from airflow.operators.s3_to_hive_operator import S3ToHiveOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MsSqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mssql_to_hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MsSqlToHiveOperator` from `airflow.providers.apache.hive.transfers.mssql_to_hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
46 46 | MsSqlToHiveOperator()
|
||||
@@ -350,16 +365,17 @@ AIR302_hive.py:50:1: AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveTran
|
||||
50 51 | MsSqlToHiveTransfer()
|
||||
51 52 |
|
||||
|
||||
AIR302_hive.py:54:1: AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:54:1
|
||||
|
|
||||
52 | from airflow.operators.s3_to_hive_operator import S3ToHiveOperator
|
||||
53 |
|
||||
54 | S3ToHiveOperator()
|
||||
| ^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
55 |
|
||||
56 | from airflow.operators.s3_to_hive_operator import S3ToHiveTransfer
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `S3ToHiveOperator` from `airflow.providers.apache.hive.transfers.s3_to_hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `S3ToHiveOperator` from `airflow.providers.apache.hive.transfers.s3_to_hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
49 49 |
|
||||
@@ -371,16 +387,17 @@ AIR302_hive.py:54:1: AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveO
|
||||
54 54 | S3ToHiveOperator()
|
||||
55 55 |
|
||||
|
||||
AIR302_hive.py:58:1: AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:58:1
|
||||
|
|
||||
56 | from airflow.operators.s3_to_hive_operator import S3ToHiveTransfer
|
||||
57 |
|
||||
58 | S3ToHiveTransfer()
|
||||
| ^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
59 |
|
||||
60 | from airflow.sensors.hive_partition_sensor import HivePartitionSensor
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `S3ToHiveOperator` from `airflow.providers.apache.hive.transfers.s3_to_hive` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `S3ToHiveOperator` from `airflow.providers.apache.hive.transfers.s3_to_hive` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
54 54 | S3ToHiveOperator()
|
||||
@@ -391,16 +408,17 @@ AIR302_hive.py:58:1: AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveT
|
||||
58 59 | S3ToHiveTransfer()
|
||||
59 60 |
|
||||
|
||||
AIR302_hive.py:62:1: AIR302 [*] `airflow.sensors.hive_partition_sensor.HivePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.hive_partition_sensor.HivePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:62:1
|
||||
|
|
||||
60 | from airflow.sensors.hive_partition_sensor import HivePartitionSensor
|
||||
61 |
|
||||
62 | HivePartitionSensor()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
63 |
|
||||
64 | from airflow.sensors.metastore_partition_sensor import MetastorePartitionSensor
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HivePartitionSensor` from `airflow.providers.apache.hive.sensors.hive_partition` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HivePartitionSensor` from `airflow.providers.apache.hive.sensors.hive_partition` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
57 57 |
|
||||
@@ -412,16 +430,17 @@ AIR302_hive.py:62:1: AIR302 [*] `airflow.sensors.hive_partition_sensor.HiveParti
|
||||
62 62 | HivePartitionSensor()
|
||||
63 63 |
|
||||
|
||||
AIR302_hive.py:66:1: AIR302 [*] `airflow.sensors.metastore_partition_sensor.MetastorePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.metastore_partition_sensor.MetastorePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:66:1
|
||||
|
|
||||
64 | from airflow.sensors.metastore_partition_sensor import MetastorePartitionSensor
|
||||
65 |
|
||||
66 | MetastorePartitionSensor()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
67 |
|
||||
68 | from airflow.sensors.named_hive_partition_sensor import NamedHivePartitionSensor
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MetastorePartitionSensor` from `airflow.providers.apache.hive.sensors.metastore_partition` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `MetastorePartitionSensor` from `airflow.providers.apache.hive.sensors.metastore_partition` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
61 61 |
|
||||
@@ -433,14 +452,15 @@ AIR302_hive.py:66:1: AIR302 [*] `airflow.sensors.metastore_partition_sensor.Meta
|
||||
66 66 | MetastorePartitionSensor()
|
||||
67 67 |
|
||||
|
||||
AIR302_hive.py:70:1: AIR302 [*] `airflow.sensors.named_hive_partition_sensor.NamedHivePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.named_hive_partition_sensor.NamedHivePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
|
||||
--> AIR302_hive.py:70:1
|
||||
|
|
||||
68 | from airflow.sensors.named_hive_partition_sensor import NamedHivePartitionSensor
|
||||
69 |
|
||||
70 | NamedHivePartitionSensor()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `NamedHivePartitionSensor` from `airflow.providers.apache.hive.sensors.named_hive_partition` instead.
|
||||
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `NamedHivePartitionSensor` from `airflow.providers.apache.hive.sensors.named_hive_partition` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
65 65 |
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_http.py:7:1: AIR302 [*] `airflow.hooks.http_hook.HttpHook` is moved into `http` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.http_hook.HttpHook` is moved into `http` provider in Airflow 3.0;
|
||||
--> AIR302_http.py:7:1
|
||||
|
|
||||
5 | from airflow.sensors.http_sensor import HttpSensor
|
||||
6 |
|
||||
7 | HttpHook()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
8 | SimpleHttpOperator()
|
||||
9 | HttpSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-http>=1.0.0` and use `HttpHook` from `airflow.providers.http.hooks.http` instead.
|
||||
help: Install `apache-airflow-providers-http>=1.0.0` and use `HttpHook` from `airflow.providers.http.hooks.http` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -23,14 +24,15 @@ AIR302_http.py:7:1: AIR302 [*] `airflow.hooks.http_hook.HttpHook` is moved into
|
||||
7 7 | HttpHook()
|
||||
8 8 | SimpleHttpOperator()
|
||||
|
||||
AIR302_http.py:8:1: AIR302 [*] `airflow.operators.http_operator.SimpleHttpOperator` is moved into `http` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.http_operator.SimpleHttpOperator` is moved into `http` provider in Airflow 3.0;
|
||||
--> AIR302_http.py:8:1
|
||||
|
|
||||
7 | HttpHook()
|
||||
8 | SimpleHttpOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
9 | HttpSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-http>=5.0.0` and use `HttpOperator` from `airflow.providers.http.operators.http` instead.
|
||||
help: Install `apache-airflow-providers-http>=5.0.0` and use `HttpOperator` from `airflow.providers.http.operators.http` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
3 3 | from airflow.hooks.http_hook import HttpHook
|
||||
@@ -43,14 +45,15 @@ AIR302_http.py:8:1: AIR302 [*] `airflow.operators.http_operator.SimpleHttpOperat
|
||||
9 |+HttpOperator()
|
||||
9 10 | HttpSensor()
|
||||
|
||||
AIR302_http.py:9:1: AIR302 [*] `airflow.sensors.http_sensor.HttpSensor` is moved into `http` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.http_sensor.HttpSensor` is moved into `http` provider in Airflow 3.0;
|
||||
--> AIR302_http.py:9:1
|
||||
|
|
||||
7 | HttpHook()
|
||||
8 | SimpleHttpOperator()
|
||||
9 | HttpSensor()
|
||||
| ^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-http>=1.0.0` and use `HttpSensor` from `airflow.providers.http.sensors.http` instead.
|
||||
help: Install `apache-airflow-providers-http>=1.0.0` and use `HttpSensor` from `airflow.providers.http.sensors.http` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_jdbc.py:8:1: AIR302 [*] `airflow.hooks.jdbc_hook.JdbcHook` is moved into `jdbc` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.jdbc_hook.JdbcHook` is moved into `jdbc` provider in Airflow 3.0;
|
||||
--> AIR302_jdbc.py:8:1
|
||||
|
|
||||
6 | )
|
||||
7 |
|
||||
8 | JdbcHook()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
9 | jaydebeapi()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-jdbc>=1.0.0` and use `JdbcHook` from `airflow.providers.jdbc.hooks.jdbc` instead.
|
||||
help: Install `apache-airflow-providers-jdbc>=1.0.0` and use `JdbcHook` from `airflow.providers.jdbc.hooks.jdbc` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -23,13 +24,14 @@ AIR302_jdbc.py:8:1: AIR302 [*] `airflow.hooks.jdbc_hook.JdbcHook` is moved into
|
||||
8 8 | JdbcHook()
|
||||
9 9 | jaydebeapi()
|
||||
|
||||
AIR302_jdbc.py:9:1: AIR302 [*] `airflow.hooks.jdbc_hook.jaydebeapi` is moved into `jdbc` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.jdbc_hook.jaydebeapi` is moved into `jdbc` provider in Airflow 3.0;
|
||||
--> AIR302_jdbc.py:9:1
|
||||
|
|
||||
8 | JdbcHook()
|
||||
9 | jaydebeapi()
|
||||
| ^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-jdbc>=1.0.0` and use `jaydebeapi` from `airflow.providers.jdbc.hooks.jdbc` instead.
|
||||
help: Install `apache-airflow-providers-jdbc>=1.0.0` and use `jaydebeapi` from `airflow.providers.jdbc.hooks.jdbc` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_kubernetes.py:22:1: AIR302 [*] `airflow.executors.kubernetes_executor_types.ALL_NAMESPACES` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.executors.kubernetes_executor_types.ALL_NAMESPACES` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:22:1
|
||||
|
|
||||
20 | )
|
||||
21 |
|
||||
22 | ALL_NAMESPACES
|
||||
| ^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^
|
||||
23 | POD_EXECUTOR_DONE_KEY
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `ALL_NAMESPACES` from `airflow.providers.cncf.kubernetes.executors.kubernetes_executor_types` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `ALL_NAMESPACES` from `airflow.providers.cncf.kubernetes.executors.kubernetes_executor_types` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -28,15 +29,16 @@ AIR302_kubernetes.py:22:1: AIR302 [*] `airflow.executors.kubernetes_executor_typ
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:23:1: AIR302 [*] `airflow.executors.kubernetes_executor_types.POD_EXECUTOR_DONE_KEY` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.executors.kubernetes_executor_types.POD_EXECUTOR_DONE_KEY` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:23:1
|
||||
|
|
||||
22 | ALL_NAMESPACES
|
||||
23 | POD_EXECUTOR_DONE_KEY
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
24 |
|
||||
25 | K8SModel()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `POD_EXECUTOR_DONE_KEY` from `airflow.providers.cncf.kubernetes.executors.kubernetes_executor_types` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `POD_EXECUTOR_DONE_KEY` from `airflow.providers.cncf.kubernetes.executors.kubernetes_executor_types` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -55,15 +57,16 @@ AIR302_kubernetes.py:23:1: AIR302 [*] `airflow.executors.kubernetes_executor_typ
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:25:1: AIR302 [*] `airflow.kubernetes.k8s_model.K8SModel` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.k8s_model.K8SModel` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:25:1
|
||||
|
|
||||
23 | POD_EXECUTOR_DONE_KEY
|
||||
24 |
|
||||
25 | K8SModel()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
26 | append_to_pod()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `K8SModel` from `airflow.providers.cncf.kubernetes.k8s_model` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `K8SModel` from `airflow.providers.cncf.kubernetes.k8s_model` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
5 5 | POD_EXECUTOR_DONE_KEY,
|
||||
@@ -82,15 +85,16 @@ AIR302_kubernetes.py:25:1: AIR302 [*] `airflow.kubernetes.k8s_model.K8SModel` is
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:26:1: AIR302 [*] `airflow.kubernetes.k8s_model.append_to_pod` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.k8s_model.append_to_pod` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:26:1
|
||||
|
|
||||
25 | K8SModel()
|
||||
26 | append_to_pod()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
27 |
|
||||
28 | _disable_verify_ssl()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `append_to_pod` from `airflow.providers.cncf.kubernetes.k8s_model` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `append_to_pod` from `airflow.providers.cncf.kubernetes.k8s_model` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
6 6 | )
|
||||
@@ -109,16 +113,17 @@ AIR302_kubernetes.py:26:1: AIR302 [*] `airflow.kubernetes.k8s_model.append_to_po
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:28:1: AIR302 [*] `airflow.kubernetes.kube_client._disable_verify_ssl` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kube_client._disable_verify_ssl` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:28:1
|
||||
|
|
||||
26 | append_to_pod()
|
||||
27 |
|
||||
28 | _disable_verify_ssl()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
29 | _enable_tcp_keepalive()
|
||||
30 | get_kube_client()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `_disable_verify_ssl` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `_disable_verify_ssl` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
9 9 | append_to_pod,
|
||||
@@ -137,14 +142,15 @@ AIR302_kubernetes.py:28:1: AIR302 [*] `airflow.kubernetes.kube_client._disable_v
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:29:1: AIR302 [*] `airflow.kubernetes.kube_client._enable_tcp_keepalive` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kube_client._enable_tcp_keepalive` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:29:1
|
||||
|
|
||||
28 | _disable_verify_ssl()
|
||||
29 | _enable_tcp_keepalive()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
30 | get_kube_client()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `_enable_tcp_keepalive` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `_enable_tcp_keepalive` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
10 10 | )
|
||||
@@ -163,16 +169,17 @@ AIR302_kubernetes.py:29:1: AIR302 [*] `airflow.kubernetes.kube_client._enable_tc
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:30:1: AIR302 [*] `airflow.kubernetes.kube_client.get_kube_client` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kube_client.get_kube_client` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:30:1
|
||||
|
|
||||
28 | _disable_verify_ssl()
|
||||
29 | _enable_tcp_keepalive()
|
||||
30 | get_kube_client()
|
||||
| ^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^
|
||||
31 |
|
||||
32 | add_pod_suffix()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `get_kube_client` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `get_kube_client` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
11 11 | from airflow.kubernetes.kube_client import (
|
||||
@@ -190,16 +197,17 @@ AIR302_kubernetes.py:30:1: AIR302 [*] `airflow.kubernetes.kube_client.get_kube_c
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:32:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.add_pod_suffix` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.add_pod_suffix` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:32:1
|
||||
|
|
||||
30 | get_kube_client()
|
||||
31 |
|
||||
32 | add_pod_suffix()
|
||||
| ^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^
|
||||
33 | annotations_for_logging_task_metadata()
|
||||
34 | create_pod_id()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=10.0.0` and use `add_unique_suffix` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=10.0.0` and use `add_unique_suffix` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
18 18 | annotations_for_logging_task_metadata,
|
||||
@@ -219,14 +227,15 @@ AIR302_kubernetes.py:32:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_func
|
||||
34 35 | create_pod_id()
|
||||
35 36 |
|
||||
|
||||
AIR302_kubernetes.py:33:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.annotations_for_logging_task_metadata` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.annotations_for_logging_task_metadata` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:33:1
|
||||
|
|
||||
32 | add_pod_suffix()
|
||||
33 | annotations_for_logging_task_metadata()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
34 | create_pod_id()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `annotations_for_logging_task_metadata` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `annotations_for_logging_task_metadata` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
15 15 | )
|
||||
@@ -240,14 +249,15 @@ AIR302_kubernetes.py:33:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_func
|
||||
22 22 | ALL_NAMESPACES
|
||||
23 23 | POD_EXECUTOR_DONE_KEY
|
||||
|
||||
AIR302_kubernetes.py:34:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.create_pod_id` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.create_pod_id` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:34:1
|
||||
|
|
||||
32 | add_pod_suffix()
|
||||
33 | annotations_for_logging_task_metadata()
|
||||
34 | create_pod_id()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=10.0.0` and use `create_unique_id` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=10.0.0` and use `create_unique_id` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
18 18 | annotations_for_logging_task_metadata,
|
||||
@@ -267,16 +277,17 @@ AIR302_kubernetes.py:34:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_func
|
||||
36 37 |
|
||||
37 38 | from airflow.kubernetes.pod_generator import (
|
||||
|
||||
AIR302_kubernetes.py:49:1: AIR302 [*] `airflow.kubernetes.pod_generator.PodDefaults` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.PodDefaults` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:49:1
|
||||
|
|
||||
47 | )
|
||||
48 |
|
||||
49 | PodDefaults()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
50 | PodGenerator()
|
||||
51 | add_pod_suffix()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodDefaults` from `airflow.providers.cncf.kubernetes.utils.xcom_sidecar` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodDefaults` from `airflow.providers.cncf.kubernetes.utils.xcom_sidecar` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
35 35 |
|
||||
@@ -295,15 +306,16 @@ AIR302_kubernetes.py:49:1: AIR302 [*] `airflow.kubernetes.pod_generator.PodDefau
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:50:1: AIR302 [*] `airflow.kubernetes.pod_generator.PodGenerator` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.PodGenerator` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:50:1
|
||||
|
|
||||
49 | PodDefaults()
|
||||
50 | PodGenerator()
|
||||
| ^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^
|
||||
51 | add_pod_suffix()
|
||||
52 | datetime_to_label_safe_datestring()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodGenerator` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodGenerator` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
36 36 |
|
||||
@@ -322,16 +334,17 @@ AIR302_kubernetes.py:50:1: AIR302 [*] `airflow.kubernetes.pod_generator.PodGener
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:51:1: AIR302 [*] `airflow.kubernetes.pod_generator.add_pod_suffix` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.add_pod_suffix` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:51:1
|
||||
|
|
||||
49 | PodDefaults()
|
||||
50 | PodGenerator()
|
||||
51 | add_pod_suffix()
|
||||
| ^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^
|
||||
52 | datetime_to_label_safe_datestring()
|
||||
53 | extend_object_field()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=10.0.0` and use `add_unique_suffix` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=10.0.0` and use `add_unique_suffix` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
45 45 | merge_objects,
|
||||
@@ -347,16 +360,17 @@ AIR302_kubernetes.py:51:1: AIR302 [*] `airflow.kubernetes.pod_generator.add_pod_
|
||||
53 54 | extend_object_field()
|
||||
54 55 | label_safe_datestring_to_datetime()
|
||||
|
||||
AIR302_kubernetes.py:52:1: AIR302 [*] `airflow.kubernetes.pod_generator.datetime_to_label_safe_datestring` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.datetime_to_label_safe_datestring` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:52:1
|
||||
|
|
||||
50 | PodGenerator()
|
||||
51 | add_pod_suffix()
|
||||
52 | datetime_to_label_safe_datestring()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
53 | extend_object_field()
|
||||
54 | label_safe_datestring_to_datetime()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `datetime_to_label_safe_datestring` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `datetime_to_label_safe_datestring` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
38 38 | PodDefaults,
|
||||
@@ -374,16 +388,17 @@ AIR302_kubernetes.py:52:1: AIR302 [*] `airflow.kubernetes.pod_generator.datetime
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:53:1: AIR302 [*] `airflow.kubernetes.pod_generator.extend_object_field` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.extend_object_field` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:53:1
|
||||
|
|
||||
51 | add_pod_suffix()
|
||||
52 | datetime_to_label_safe_datestring()
|
||||
53 | extend_object_field()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
54 | label_safe_datestring_to_datetime()
|
||||
55 | make_safe_label_value()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `extend_object_field` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `extend_object_field` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
39 39 | PodGenerator,
|
||||
@@ -400,16 +415,17 @@ AIR302_kubernetes.py:53:1: AIR302 [*] `airflow.kubernetes.pod_generator.extend_o
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:54:1: AIR302 [*] `airflow.kubernetes.pod_generator.label_safe_datestring_to_datetime` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.label_safe_datestring_to_datetime` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:54:1
|
||||
|
|
||||
52 | datetime_to_label_safe_datestring()
|
||||
53 | extend_object_field()
|
||||
54 | label_safe_datestring_to_datetime()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
55 | make_safe_label_value()
|
||||
56 | merge_objects()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `label_safe_datestring_to_datetime` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `label_safe_datestring_to_datetime` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
40 40 | add_pod_suffix,
|
||||
@@ -425,16 +441,17 @@ AIR302_kubernetes.py:54:1: AIR302 [*] `airflow.kubernetes.pod_generator.label_sa
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:55:1: AIR302 [*] `airflow.kubernetes.pod_generator.make_safe_label_value` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.make_safe_label_value` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:55:1
|
||||
|
|
||||
53 | extend_object_field()
|
||||
54 | label_safe_datestring_to_datetime()
|
||||
55 | make_safe_label_value()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
56 | merge_objects()
|
||||
57 | rand_str()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `make_safe_label_value` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `make_safe_label_value` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
41 41 | datetime_to_label_safe_datestring,
|
||||
@@ -449,15 +466,16 @@ AIR302_kubernetes.py:55:1: AIR302 [*] `airflow.kubernetes.pod_generator.make_saf
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:56:1: AIR302 [*] `airflow.kubernetes.pod_generator.merge_objects` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.merge_objects` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:56:1
|
||||
|
|
||||
54 | label_safe_datestring_to_datetime()
|
||||
55 | make_safe_label_value()
|
||||
56 | merge_objects()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
57 | rand_str()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `merge_objects` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `merge_objects` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
42 42 | extend_object_field,
|
||||
@@ -471,16 +489,17 @@ AIR302_kubernetes.py:56:1: AIR302 [*] `airflow.kubernetes.pod_generator.merge_ob
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:57:1: AIR302 [*] `airflow.kubernetes.pod_generator.rand_str` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.rand_str` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:57:1
|
||||
|
|
||||
55 | make_safe_label_value()
|
||||
56 | merge_objects()
|
||||
57 | rand_str()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
58 |
|
||||
59 | from airflow.kubernetes.pod_generator_deprecated import (
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `rand_str` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `rand_str` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
43 43 | label_safe_datestring_to_datetime,
|
||||
@@ -493,16 +512,17 @@ AIR302_kubernetes.py:57:1: AIR302 [*] `airflow.kubernetes.pod_generator.rand_str
|
||||
49 49 | PodDefaults()
|
||||
50 50 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:69:1: AIR302 [*] `airflow.kubernetes.pod_generator_deprecated.PodDefaults` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator_deprecated.PodDefaults` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:69:1
|
||||
|
|
||||
67 | )
|
||||
68 |
|
||||
69 | PodDefaults()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
70 | PodGenerator()
|
||||
71 | make_safe_label_value()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodDefaults` from `airflow.providers.cncf.kubernetes.utils.xcom_sidecar` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodDefaults` from `airflow.providers.cncf.kubernetes.utils.xcom_sidecar` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
57 57 | rand_str()
|
||||
@@ -521,14 +541,15 @@ AIR302_kubernetes.py:69:1: AIR302 [*] `airflow.kubernetes.pod_generator_deprecat
|
||||
69 69 | PodDefaults()
|
||||
70 70 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:70:1: AIR302 [*] `airflow.kubernetes.pod_generator_deprecated.PodGenerator` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator_deprecated.PodGenerator` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:70:1
|
||||
|
|
||||
69 | PodDefaults()
|
||||
70 | PodGenerator()
|
||||
| ^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^
|
||||
71 | make_safe_label_value()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodGenerator` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodGenerator` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
58 58 |
|
||||
@@ -546,16 +567,17 @@ AIR302_kubernetes.py:70:1: AIR302 [*] `airflow.kubernetes.pod_generator_deprecat
|
||||
69 69 | PodDefaults()
|
||||
70 70 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:71:1: AIR302 [*] `airflow.kubernetes.pod_generator_deprecated.make_safe_label_value` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator_deprecated.make_safe_label_value` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:71:1
|
||||
|
|
||||
69 | PodDefaults()
|
||||
70 | PodGenerator()
|
||||
71 | make_safe_label_value()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
72 |
|
||||
73 | PodLauncher()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `make_safe_label_value` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `make_safe_label_value` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
59 59 | from airflow.kubernetes.pod_generator_deprecated import (
|
||||
@@ -572,15 +594,16 @@ AIR302_kubernetes.py:71:1: AIR302 [*] `airflow.kubernetes.pod_generator_deprecat
|
||||
69 69 | PodDefaults()
|
||||
70 70 | PodGenerator()
|
||||
|
||||
AIR302_kubernetes.py:73:1: AIR302 [*] `airflow.kubernetes.pod_launcher.PodLauncher` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_launcher.PodLauncher` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:73:1
|
||||
|
|
||||
71 | make_safe_label_value()
|
||||
72 |
|
||||
73 | PodLauncher()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
74 | PodStatus()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodManager` from `airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodManager` from `airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
65 65 | PodLauncher,
|
||||
@@ -598,15 +621,16 @@ AIR302_kubernetes.py:73:1: AIR302 [*] `airflow.kubernetes.pod_launcher.PodLaunch
|
||||
75 76 |
|
||||
76 77 | from airflow.kubernetes.pod_launcher_deprecated import (
|
||||
|
||||
AIR302_kubernetes.py:74:1: AIR302 [*] `airflow.kubernetes.pod_launcher.PodStatus` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_launcher.PodStatus` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:74:1
|
||||
|
|
||||
73 | PodLauncher()
|
||||
74 | PodStatus()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
75 |
|
||||
76 | from airflow.kubernetes.pod_launcher_deprecated import (
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodPhase` from ` airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodPhase` from ` airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
65 65 | PodLauncher,
|
||||
@@ -625,16 +649,17 @@ AIR302_kubernetes.py:74:1: AIR302 [*] `airflow.kubernetes.pod_launcher.PodStatus
|
||||
76 77 | from airflow.kubernetes.pod_launcher_deprecated import (
|
||||
77 78 | PodDefaults,
|
||||
|
||||
AIR302_kubernetes.py:90:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.PodDefaults` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.PodDefaults` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:90:1
|
||||
|
|
||||
88 | from airflow.kubernetes.volume_mount import VolumeMount
|
||||
89 |
|
||||
90 | PodDefaults()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
91 | PodLauncher()
|
||||
92 | PodStatus()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodDefaults` from `airflow.providers.cncf.kubernetes.utils.xcom_sidecar` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodDefaults` from `airflow.providers.cncf.kubernetes.utils.xcom_sidecar` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
74 74 | PodStatus()
|
||||
@@ -653,15 +678,16 @@ AIR302_kubernetes.py:90:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecate
|
||||
90 90 | PodDefaults()
|
||||
91 91 | PodLauncher()
|
||||
|
||||
AIR302_kubernetes.py:91:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.PodLauncher` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.PodLauncher` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:91:1
|
||||
|
|
||||
90 | PodDefaults()
|
||||
91 | PodLauncher()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
92 | PodStatus()
|
||||
93 | get_kube_client()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodManager` from `airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodManager` from `airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
86 86 | )
|
||||
@@ -676,15 +702,16 @@ AIR302_kubernetes.py:91:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecate
|
||||
93 94 | get_kube_client()
|
||||
94 95 |
|
||||
|
||||
AIR302_kubernetes.py:92:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.PodStatus` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.PodStatus` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:92:1
|
||||
|
|
||||
90 | PodDefaults()
|
||||
91 | PodLauncher()
|
||||
92 | PodStatus()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
93 | get_kube_client()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodPhase` from ` airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=3.0.0` and use `PodPhase` from ` airflow.providers.cncf.kubernetes.utils.pod_manager` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
86 86 | )
|
||||
@@ -700,16 +727,17 @@ AIR302_kubernetes.py:92:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecate
|
||||
94 95 |
|
||||
95 96 | PodRuntimeInfoEnv()
|
||||
|
||||
AIR302_kubernetes.py:93:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.get_kube_client` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_launcher_deprecated.get_kube_client` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:93:1
|
||||
|
|
||||
91 | PodLauncher()
|
||||
92 | PodStatus()
|
||||
93 | get_kube_client()
|
||||
| ^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^
|
||||
94 |
|
||||
95 | PodRuntimeInfoEnv()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `get_kube_client` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `get_kube_client` from `airflow.providers.cncf.kubernetes.kube_client` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
77 77 | PodDefaults,
|
||||
@@ -728,16 +756,17 @@ AIR302_kubernetes.py:93:1: AIR302 [*] `airflow.kubernetes.pod_launcher_deprecate
|
||||
90 90 | PodDefaults()
|
||||
91 91 | PodLauncher()
|
||||
|
||||
AIR302_kubernetes.py:95:1: AIR302 [*] `airflow.kubernetes.pod_runtime_info_env.PodRuntimeInfoEnv` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_runtime_info_env.PodRuntimeInfoEnv` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:95:1
|
||||
|
|
||||
93 | get_kube_client()
|
||||
94 |
|
||||
95 | PodRuntimeInfoEnv()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
96 | K8SModel()
|
||||
97 | Secret()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `V1EnvVar` from `kubernetes.client.models` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `V1EnvVar` from `kubernetes.client.models` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
86 86 | )
|
||||
@@ -756,15 +785,16 @@ AIR302_kubernetes.py:95:1: AIR302 [*] `airflow.kubernetes.pod_runtime_info_env.P
|
||||
97 98 | Secret()
|
||||
98 99 | Volume()
|
||||
|
||||
AIR302_kubernetes.py:96:1: AIR302 [*] `airflow.kubernetes.secret.K8SModel` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.secret.K8SModel` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:96:1
|
||||
|
|
||||
95 | PodRuntimeInfoEnv()
|
||||
96 | K8SModel()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
97 | Secret()
|
||||
98 | Volume()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `K8SModel` from `airflow.providers.cncf.kubernetes.k8s_model` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `K8SModel` from `airflow.providers.cncf.kubernetes.k8s_model` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
81 81 | )
|
||||
@@ -780,16 +810,17 @@ AIR302_kubernetes.py:96:1: AIR302 [*] `airflow.kubernetes.secret.K8SModel` is mo
|
||||
90 90 | PodDefaults()
|
||||
91 91 | PodLauncher()
|
||||
|
||||
AIR302_kubernetes.py:97:1: AIR302 [*] `airflow.kubernetes.secret.Secret` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.secret.Secret` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:97:1
|
||||
|
|
||||
95 | PodRuntimeInfoEnv()
|
||||
96 | K8SModel()
|
||||
97 | Secret()
|
||||
| ^^^^^^ AIR302
|
||||
| ^^^^^^
|
||||
98 | Volume()
|
||||
99 | VolumeMount()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `Secret` from `airflow.providers.cncf.kubernetes.secret` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `Secret` from `airflow.providers.cncf.kubernetes.secret` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
82 82 | from airflow.kubernetes.pod_runtime_info_env import PodRuntimeInfoEnv
|
||||
@@ -804,15 +835,16 @@ AIR302_kubernetes.py:97:1: AIR302 [*] `airflow.kubernetes.secret.Secret` is move
|
||||
90 90 | PodDefaults()
|
||||
91 91 | PodLauncher()
|
||||
|
||||
AIR302_kubernetes.py:98:1: AIR302 [*] `airflow.kubernetes.volume.Volume` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.volume.Volume` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:98:1
|
||||
|
|
||||
96 | K8SModel()
|
||||
97 | Secret()
|
||||
98 | Volume()
|
||||
| ^^^^^^ AIR302
|
||||
| ^^^^^^
|
||||
99 | VolumeMount()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `V1Volume` from `kubernetes.client.models` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `V1Volume` from `kubernetes.client.models` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
86 86 | )
|
||||
@@ -832,16 +864,17 @@ AIR302_kubernetes.py:98:1: AIR302 [*] `airflow.kubernetes.volume.Volume` is move
|
||||
100 101 |
|
||||
101 102 | from airflow.kubernetes.kubernetes_helper_functions import (
|
||||
|
||||
AIR302_kubernetes.py:99:1: AIR302 [*] `airflow.kubernetes.volume_mount.VolumeMount` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.volume_mount.VolumeMount` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:99:1
|
||||
|
|
||||
97 | Secret()
|
||||
98 | Volume()
|
||||
99 | VolumeMount()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
100 |
|
||||
101 | from airflow.kubernetes.kubernetes_helper_functions import (
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `V1VolumeMount` from `kubernetes.client.models` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `V1VolumeMount` from `kubernetes.client.models` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
86 86 | )
|
||||
@@ -861,16 +894,17 @@ AIR302_kubernetes.py:99:1: AIR302 [*] `airflow.kubernetes.volume_mount.VolumeMou
|
||||
101 102 | from airflow.kubernetes.kubernetes_helper_functions import (
|
||||
102 103 | annotations_to_key,
|
||||
|
||||
AIR302_kubernetes.py:107:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.annotations_to_key` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.annotations_to_key` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:107:1
|
||||
|
|
||||
105 | )
|
||||
106 |
|
||||
107 | annotations_to_key()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
108 | get_logs_task_metadata()
|
||||
109 | rand_str()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `annotations_to_key` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `annotations_to_key` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
99 99 | VolumeMount()
|
||||
@@ -885,14 +919,15 @@ AIR302_kubernetes.py:107:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_fun
|
||||
107 107 | annotations_to_key()
|
||||
108 108 | get_logs_task_metadata()
|
||||
|
||||
AIR302_kubernetes.py:108:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.get_logs_task_metadata` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.get_logs_task_metadata` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:108:1
|
||||
|
|
||||
107 | annotations_to_key()
|
||||
108 | get_logs_task_metadata()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
109 | rand_str()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `get_logs_task_metadata` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `get_logs_task_metadata` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
100 100 |
|
||||
@@ -906,16 +941,17 @@ AIR302_kubernetes.py:108:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_fun
|
||||
107 107 | annotations_to_key()
|
||||
108 108 | get_logs_task_metadata()
|
||||
|
||||
AIR302_kubernetes.py:109:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.rand_str` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.rand_str` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:109:1
|
||||
|
|
||||
107 | annotations_to_key()
|
||||
108 | get_logs_task_metadata()
|
||||
109 | rand_str()
|
||||
| ^^^^^^^^ AIR302
|
||||
| ^^^^^^^^
|
||||
110 |
|
||||
111 | from airflow.kubernetes.pod_generator import PodGeneratorDeprecated
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `rand_str` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `rand_str` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
101 101 | from airflow.kubernetes.kubernetes_helper_functions import (
|
||||
@@ -928,14 +964,15 @@ AIR302_kubernetes.py:109:1: AIR302 [*] `airflow.kubernetes.kubernetes_helper_fun
|
||||
107 107 | annotations_to_key()
|
||||
108 108 | get_logs_task_metadata()
|
||||
|
||||
AIR302_kubernetes.py:113:1: AIR302 [*] `airflow.kubernetes.pod_generator.PodGeneratorDeprecated` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.kubernetes.pod_generator.PodGeneratorDeprecated` is moved into `cncf-kubernetes` provider in Airflow 3.0;
|
||||
--> AIR302_kubernetes.py:113:1
|
||||
|
|
||||
111 | from airflow.kubernetes.pod_generator import PodGeneratorDeprecated
|
||||
112 |
|
||||
113 | PodGeneratorDeprecated()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodGenerator` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodGenerator` from `airflow.providers.cncf.kubernetes.pod_generator` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
109 109 | rand_str()
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_mysql.py:9:1: AIR302 [*] `airflow.hooks.mysql_hook.MySqlHook` is moved into `mysql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.mysql_hook.MySqlHook` is moved into `mysql` provider in Airflow 3.0;
|
||||
--> AIR302_mysql.py:9:1
|
||||
|
|
||||
7 | )
|
||||
8 |
|
||||
9 | MySqlHook()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
10 | PrestoToMySqlOperator()
|
||||
11 | PrestoToMySqlTransfer()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-mysql>=1.0.0` and use `MySqlHook` from `airflow.providers.mysql.hooks.mysql` instead.
|
||||
help: Install `apache-airflow-providers-mysql>=1.0.0` and use `MySqlHook` from `airflow.providers.mysql.hooks.mysql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -25,14 +26,15 @@ AIR302_mysql.py:9:1: AIR302 [*] `airflow.hooks.mysql_hook.MySqlHook` is moved in
|
||||
9 9 | MySqlHook()
|
||||
10 10 | PrestoToMySqlOperator()
|
||||
|
||||
AIR302_mysql.py:10:1: AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlOperator` is moved into `mysql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlOperator` is moved into `mysql` provider in Airflow 3.0;
|
||||
--> AIR302_mysql.py:10:1
|
||||
|
|
||||
9 | MySqlHook()
|
||||
10 | PrestoToMySqlOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
11 | PrestoToMySqlTransfer()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-mysql>=1.0.0` and use `PrestoToMySqlOperator` from `airflow.providers.mysql.transfers.presto_to_mysql` instead.
|
||||
help: Install `apache-airflow-providers-mysql>=1.0.0` and use `PrestoToMySqlOperator` from `airflow.providers.mysql.transfers.presto_to_mysql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -46,14 +48,15 @@ AIR302_mysql.py:10:1: AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySq
|
||||
9 9 | MySqlHook()
|
||||
10 10 | PrestoToMySqlOperator()
|
||||
|
||||
AIR302_mysql.py:11:1: AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlTransfer` is moved into `mysql` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlTransfer` is moved into `mysql` provider in Airflow 3.0;
|
||||
--> AIR302_mysql.py:11:1
|
||||
|
|
||||
9 | MySqlHook()
|
||||
10 | PrestoToMySqlOperator()
|
||||
11 | PrestoToMySqlTransfer()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-mysql>=1.0.0` and use `PrestoToMySqlOperator` from `airflow.providers.mysql.transfers.presto_to_mysql` instead.
|
||||
help: Install `apache-airflow-providers-mysql>=1.0.0` and use `PrestoToMySqlOperator` from `airflow.providers.mysql.transfers.presto_to_mysql` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_oracle.py:5:1: AIR302 [*] `airflow.hooks.oracle_hook.OracleHook` is moved into `oracle` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.oracle_hook.OracleHook` is moved into `oracle` provider in Airflow 3.0;
|
||||
--> AIR302_oracle.py:5:1
|
||||
|
|
||||
3 | from airflow.hooks.oracle_hook import OracleHook
|
||||
4 |
|
||||
5 | OracleHook()
|
||||
| ^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-oracle>=1.0.0` and use `OracleHook` from `airflow.providers.oracle.hooks.oracle` instead.
|
||||
help: Install `apache-airflow-providers-oracle>=1.0.0` and use `OracleHook` from `airflow.providers.oracle.hooks.oracle` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_papermill.py:5:1: AIR302 [*] `airflow.operators.papermill_operator.PapermillOperator` is moved into `papermill` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.papermill_operator.PapermillOperator` is moved into `papermill` provider in Airflow 3.0;
|
||||
--> AIR302_papermill.py:5:1
|
||||
|
|
||||
3 | from airflow.operators.papermill_operator import PapermillOperator
|
||||
4 |
|
||||
5 | PapermillOperator()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-papermill>=1.0.0` and use `PapermillOperator` from `airflow.providers.papermill.operators.papermill` instead.
|
||||
help: Install `apache-airflow-providers-papermill>=1.0.0` and use `PapermillOperator` from `airflow.providers.papermill.operators.papermill` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_pig.py:6:1: AIR302 [*] `airflow.hooks.pig_hook.PigCliHook` is moved into `apache-pig` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.pig_hook.PigCliHook` is moved into `apache-pig` provider in Airflow 3.0;
|
||||
--> AIR302_pig.py:6:1
|
||||
|
|
||||
4 | from airflow.operators.pig_operator import PigOperator
|
||||
5 |
|
||||
6 | PigCliHook()
|
||||
| ^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^
|
||||
7 | PigOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-pig>=1.0.0` and use `PigCliHook` from `airflow.providers.apache.pig.hooks.pig` instead.
|
||||
help: Install `apache-airflow-providers-apache-pig>=1.0.0` and use `PigCliHook` from `airflow.providers.apache.pig.hooks.pig` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -21,13 +22,14 @@ AIR302_pig.py:6:1: AIR302 [*] `airflow.hooks.pig_hook.PigCliHook` is moved into
|
||||
6 6 | PigCliHook()
|
||||
7 7 | PigOperator()
|
||||
|
||||
AIR302_pig.py:7:1: AIR302 [*] `airflow.operators.pig_operator.PigOperator` is moved into `apache-pig` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.pig_operator.PigOperator` is moved into `apache-pig` provider in Airflow 3.0;
|
||||
--> AIR302_pig.py:7:1
|
||||
|
|
||||
6 | PigCliHook()
|
||||
7 | PigOperator()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-apache-pig>=1.0.0` and use `PigOperator` from `airflow.providers.apache.pig.operators.pig` instead.
|
||||
help: Install `apache-airflow-providers-apache-pig>=1.0.0` and use `PigOperator` from `airflow.providers.apache.pig.operators.pig` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_postgres.py:6:1: AIR302 [*] `airflow.hooks.postgres_hook.PostgresHook` is moved into `postgres` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.postgres_hook.PostgresHook` is moved into `postgres` provider in Airflow 3.0;
|
||||
--> AIR302_postgres.py:6:1
|
||||
|
|
||||
4 | from airflow.operators.postgres_operator import Mapping
|
||||
5 |
|
||||
6 | PostgresHook()
|
||||
| ^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^
|
||||
7 | Mapping()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-postgres>=1.0.0` and use `PostgresHook` from `airflow.providers.postgres.hooks.postgres` instead.
|
||||
help: Install `apache-airflow-providers-postgres>=1.0.0` and use `PostgresHook` from `airflow.providers.postgres.hooks.postgres` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -21,9 +22,10 @@ AIR302_postgres.py:6:1: AIR302 [*] `airflow.hooks.postgres_hook.PostgresHook` is
|
||||
6 6 | PostgresHook()
|
||||
7 7 | Mapping()
|
||||
|
||||
AIR302_postgres.py:7:1: AIR302 `airflow.operators.postgres_operator.Mapping` is removed in Airflow 3.0
|
||||
AIR302 `airflow.operators.postgres_operator.Mapping` is removed in Airflow 3.0
|
||||
--> AIR302_postgres.py:7:1
|
||||
|
|
||||
6 | PostgresHook()
|
||||
7 | Mapping()
|
||||
| ^^^^^^^ AIR302
|
||||
| ^^^^^^^
|
||||
|
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_presto.py:5:1: AIR302 [*] `airflow.hooks.presto_hook.PrestoHook` is moved into `presto` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.presto_hook.PrestoHook` is moved into `presto` provider in Airflow 3.0;
|
||||
--> AIR302_presto.py:5:1
|
||||
|
|
||||
3 | from airflow.hooks.presto_hook import PrestoHook
|
||||
4 |
|
||||
5 | PrestoHook()
|
||||
| ^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-presto>=1.0.0` and use `PrestoHook` from `airflow.providers.presto.hooks.presto` instead.
|
||||
help: Install `apache-airflow-providers-presto>=1.0.0` and use `PrestoHook` from `airflow.providers.presto.hooks.presto` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_samba.py:5:1: AIR302 [*] `airflow.hooks.samba_hook.SambaHook` is moved into `samba` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.samba_hook.SambaHook` is moved into `samba` provider in Airflow 3.0;
|
||||
--> AIR302_samba.py:5:1
|
||||
|
|
||||
3 | from airflow.hooks.samba_hook import SambaHook
|
||||
4 |
|
||||
5 | SambaHook()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-samba>=1.0.0` and use `SambaHook` from `airflow.providers.samba.hooks.samba` instead.
|
||||
help: Install `apache-airflow-providers-samba>=1.0.0` and use `SambaHook` from `airflow.providers.samba.hooks.samba` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_slack.py:6:1: AIR302 [*] `airflow.hooks.slack_hook.SlackHook` is moved into `slack` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.slack_hook.SlackHook` is moved into `slack` provider in Airflow 3.0;
|
||||
--> AIR302_slack.py:6:1
|
||||
|
|
||||
4 | from airflow.operators.slack_operator import SlackAPIOperator, SlackAPIPostOperator
|
||||
5 |
|
||||
6 | SlackHook()
|
||||
| ^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^
|
||||
7 | SlackAPIOperator()
|
||||
8 | SlackAPIPostOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackHook` from `airflow.providers.slack.hooks.slack` instead.
|
||||
help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackHook` from `airflow.providers.slack.hooks.slack` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -22,14 +23,15 @@ AIR302_slack.py:6:1: AIR302 [*] `airflow.hooks.slack_hook.SlackHook` is moved in
|
||||
6 6 | SlackHook()
|
||||
7 7 | SlackAPIOperator()
|
||||
|
||||
AIR302_slack.py:7:1: AIR302 [*] `airflow.operators.slack_operator.SlackAPIOperator` is moved into `slack` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.slack_operator.SlackAPIOperator` is moved into `slack` provider in Airflow 3.0;
|
||||
--> AIR302_slack.py:7:1
|
||||
|
|
||||
6 | SlackHook()
|
||||
7 | SlackAPIOperator()
|
||||
| ^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
8 | SlackAPIPostOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackAPIOperator` from `airflow.providers.slack.operators.slack` instead.
|
||||
help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackAPIOperator` from `airflow.providers.slack.operators.slack` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -42,14 +44,15 @@ AIR302_slack.py:7:1: AIR302 [*] `airflow.operators.slack_operator.SlackAPIOperat
|
||||
6 7 | SlackHook()
|
||||
7 8 | SlackAPIOperator()
|
||||
|
||||
AIR302_slack.py:8:1: AIR302 [*] `airflow.operators.slack_operator.SlackAPIPostOperator` is moved into `slack` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.slack_operator.SlackAPIPostOperator` is moved into `slack` provider in Airflow 3.0;
|
||||
--> AIR302_slack.py:8:1
|
||||
|
|
||||
6 | SlackHook()
|
||||
7 | SlackAPIOperator()
|
||||
8 | SlackAPIPostOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackAPIPostOperator` from `airflow.providers.slack.operators.slack` instead.
|
||||
help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackAPIPostOperator` from `airflow.providers.slack.operators.slack` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_smtp.py:5:1: AIR302 [*] `airflow.operators.email_operator.EmailOperator` is moved into `smtp` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.email_operator.EmailOperator` is moved into `smtp` provider in Airflow 3.0;
|
||||
--> AIR302_smtp.py:5:1
|
||||
|
|
||||
3 | from airflow.operators.email_operator import EmailOperator
|
||||
4 |
|
||||
5 | EmailOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
6 |
|
||||
7 | from airflow.operators.email import EmailOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-smtp>=1.0.0` and use `EmailOperator` from `airflow.providers.smtp.operators.smtp` instead.
|
||||
help: Install `apache-airflow-providers-smtp>=1.0.0` and use `EmailOperator` from `airflow.providers.smtp.operators.smtp` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -21,14 +22,15 @@ AIR302_smtp.py:5:1: AIR302 [*] `airflow.operators.email_operator.EmailOperator`
|
||||
5 5 | EmailOperator()
|
||||
6 6 |
|
||||
|
||||
AIR302_smtp.py:9:1: AIR302 [*] `airflow.operators.email.EmailOperator` is moved into `smtp` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.email.EmailOperator` is moved into `smtp` provider in Airflow 3.0;
|
||||
--> AIR302_smtp.py:9:1
|
||||
|
|
||||
7 | from airflow.operators.email import EmailOperator
|
||||
8 |
|
||||
9 | EmailOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-smtp>=1.0.0` and use `EmailOperator` from `airflow.providers.smtp.operators.smtp` instead.
|
||||
help: Install `apache-airflow-providers-smtp>=1.0.0` and use `EmailOperator` from `airflow.providers.smtp.operators.smtp` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
4 4 |
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_sqlite.py:5:1: AIR302 [*] `airflow.hooks.sqlite_hook.SqliteHook` is moved into `sqlite` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.sqlite_hook.SqliteHook` is moved into `sqlite` provider in Airflow 3.0;
|
||||
--> AIR302_sqlite.py:5:1
|
||||
|
|
||||
3 | from airflow.hooks.sqlite_hook import SqliteHook
|
||||
4 |
|
||||
5 | SqliteHook()
|
||||
| ^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-sqlite>=1.0.0` and use `SqliteHook` from `airflow.providers.sqlite.hooks.sqlite` instead.
|
||||
help: Install `apache-airflow-providers-sqlite>=1.0.0` and use `SqliteHook` from `airflow.providers.sqlite.hooks.sqlite` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_standard.py:20:1: AIR302 [*] `airflow.operators.bash_operator.BashOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.bash_operator.BashOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:20:1
|
||||
|
|
||||
18 | )
|
||||
19 |
|
||||
20 | BashOperator()
|
||||
| ^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^
|
||||
21 |
|
||||
22 | TriggerDagRunLink()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `BashOperator` from `airflow.providers.standard.operators.bash` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BashOperator` from `airflow.providers.standard.operators.bash` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -28,15 +29,16 @@ AIR302_standard.py:20:1: AIR302 [*] `airflow.operators.bash_operator.BashOperato
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:22:1: AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunLink` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunLink` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:22:1
|
||||
|
|
||||
20 | BashOperator()
|
||||
21 |
|
||||
22 | TriggerDagRunLink()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
23 | TriggerDagRunOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunLink` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunLink` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -55,15 +57,16 @@ AIR302_standard.py:22:1: AIR302 [*] `airflow.operators.dagrun_operator.TriggerDa
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:23:1: AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:23:1
|
||||
|
|
||||
22 | TriggerDagRunLink()
|
||||
23 | TriggerDagRunOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
24 |
|
||||
25 | LatestOnlyOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunOperator` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunOperator` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
3 3 | from airflow.operators.bash_operator import BashOperator
|
||||
@@ -82,16 +85,17 @@ AIR302_standard.py:23:1: AIR302 [*] `airflow.operators.dagrun_operator.TriggerDa
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:25:1: AIR302 [*] `airflow.operators.latest_only_operator.LatestOnlyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.latest_only_operator.LatestOnlyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:25:1
|
||||
|
|
||||
23 | TriggerDagRunOperator()
|
||||
24 |
|
||||
25 | LatestOnlyOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
26 |
|
||||
27 | BranchPythonOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `LatestOnlyOperator` from `airflow.providers.standard.operators.latest_only` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `LatestOnlyOperator` from `airflow.providers.standard.operators.latest_only` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
5 5 | TriggerDagRunLink,
|
||||
@@ -110,16 +114,17 @@ AIR302_standard.py:25:1: AIR302 [*] `airflow.operators.latest_only_operator.Late
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:27:1: AIR302 [*] `airflow.operators.python_operator.BranchPythonOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.python_operator.BranchPythonOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:27:1
|
||||
|
|
||||
25 | LatestOnlyOperator()
|
||||
26 |
|
||||
27 | BranchPythonOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
28 | PythonOperator()
|
||||
29 | PythonVirtualenvOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchPythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchPythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
7 7 | )
|
||||
@@ -138,15 +143,16 @@ AIR302_standard.py:27:1: AIR302 [*] `airflow.operators.python_operator.BranchPyt
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:28:1: AIR302 [*] `airflow.operators.python_operator.PythonOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.python_operator.PythonOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:28:1
|
||||
|
|
||||
27 | BranchPythonOperator()
|
||||
28 | PythonOperator()
|
||||
| ^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^
|
||||
29 | PythonVirtualenvOperator()
|
||||
30 | ShortCircuitOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
8 8 | from airflow.operators.latest_only_operator import LatestOnlyOperator
|
||||
@@ -165,15 +171,16 @@ AIR302_standard.py:28:1: AIR302 [*] `airflow.operators.python_operator.PythonOpe
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:29:1: AIR302 [*] `airflow.operators.python_operator.PythonVirtualenvOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.python_operator.PythonVirtualenvOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:29:1
|
||||
|
|
||||
27 | BranchPythonOperator()
|
||||
28 | PythonOperator()
|
||||
29 | PythonVirtualenvOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
30 | ShortCircuitOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonVirtualenvOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonVirtualenvOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
9 9 | from airflow.operators.python_operator import (
|
||||
@@ -191,16 +198,17 @@ AIR302_standard.py:29:1: AIR302 [*] `airflow.operators.python_operator.PythonVir
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:30:1: AIR302 [*] `airflow.operators.python_operator.ShortCircuitOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.python_operator.ShortCircuitOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:30:1
|
||||
|
|
||||
28 | PythonOperator()
|
||||
29 | PythonVirtualenvOperator()
|
||||
30 | ShortCircuitOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
31 |
|
||||
32 | ExternalTaskMarker()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `ShortCircuitOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `ShortCircuitOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
10 10 | BranchPythonOperator,
|
||||
@@ -217,15 +225,16 @@ AIR302_standard.py:30:1: AIR302 [*] `airflow.operators.python_operator.ShortCirc
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:32:1: AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskMarker` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskMarker` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:32:1
|
||||
|
|
||||
30 | ShortCircuitOperator()
|
||||
31 |
|
||||
32 | ExternalTaskMarker()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
33 | ExternalTaskSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskMarker` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskMarker` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
13 13 | ShortCircuitOperator,
|
||||
@@ -239,13 +248,14 @@ AIR302_standard.py:32:1: AIR302 [*] `airflow.sensors.external_task_sensor.Extern
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:33:1: AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensor` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensor` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:33:1
|
||||
|
|
||||
32 | ExternalTaskMarker()
|
||||
33 | ExternalTaskSensor()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskSensor` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskSensor` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
14 14 | )
|
||||
@@ -258,16 +268,17 @@ AIR302_standard.py:33:1: AIR302 [*] `airflow.sensors.external_task_sensor.Extern
|
||||
20 20 | BashOperator()
|
||||
21 21 |
|
||||
|
||||
AIR302_standard.py:38:1: AIR302 [*] `airflow.hooks.subprocess.SubprocessResult` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.subprocess.SubprocessResult` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:38:1
|
||||
|
|
||||
36 | from airflow.hooks.subprocess import SubprocessResult
|
||||
37 |
|
||||
38 | SubprocessResult()
|
||||
| ^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
39 |
|
||||
40 | from airflow.hooks.subprocess import working_directory
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `SubprocessResult` from `airflow.providers.standard.hooks.subprocess` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `SubprocessResult` from `airflow.providers.standard.hooks.subprocess` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
33 33 | ExternalTaskSensor()
|
||||
@@ -279,16 +290,17 @@ AIR302_standard.py:38:1: AIR302 [*] `airflow.hooks.subprocess.SubprocessResult`
|
||||
38 38 | SubprocessResult()
|
||||
39 39 |
|
||||
|
||||
AIR302_standard.py:42:1: AIR302 [*] `airflow.hooks.subprocess.working_directory` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.subprocess.working_directory` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:42:1
|
||||
|
|
||||
40 | from airflow.hooks.subprocess import working_directory
|
||||
41 |
|
||||
42 | working_directory()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
43 |
|
||||
44 | from airflow.operators.datetime import target_times_as_dates
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `working_directory` from `airflow.providers.standard.hooks.subprocess` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `working_directory` from `airflow.providers.standard.hooks.subprocess` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
37 37 |
|
||||
@@ -300,16 +312,17 @@ AIR302_standard.py:42:1: AIR302 [*] `airflow.hooks.subprocess.working_directory`
|
||||
42 42 | working_directory()
|
||||
43 43 |
|
||||
|
||||
AIR302_standard.py:46:1: AIR302 [*] `airflow.operators.datetime.target_times_as_dates` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.datetime.target_times_as_dates` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:46:1
|
||||
|
|
||||
44 | from airflow.operators.datetime import target_times_as_dates
|
||||
45 |
|
||||
46 | target_times_as_dates()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
47 |
|
||||
48 | from airflow.operators.trigger_dagrun import TriggerDagRunLink
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `target_times_as_dates` from `airflow.providers.standard.operators.datetime` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `target_times_as_dates` from `airflow.providers.standard.operators.datetime` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
41 41 |
|
||||
@@ -321,16 +334,17 @@ AIR302_standard.py:46:1: AIR302 [*] `airflow.operators.datetime.target_times_as_
|
||||
46 46 | target_times_as_dates()
|
||||
47 47 |
|
||||
|
||||
AIR302_standard.py:50:1: AIR302 [*] `airflow.operators.trigger_dagrun.TriggerDagRunLink` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.trigger_dagrun.TriggerDagRunLink` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:50:1
|
||||
|
|
||||
48 | from airflow.operators.trigger_dagrun import TriggerDagRunLink
|
||||
49 |
|
||||
50 | TriggerDagRunLink()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
51 |
|
||||
52 | from airflow.sensors.external_task import ExternalTaskSensorLink
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunLink` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunLink` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
45 45 |
|
||||
@@ -342,16 +356,17 @@ AIR302_standard.py:50:1: AIR302 [*] `airflow.operators.trigger_dagrun.TriggerDag
|
||||
50 50 | TriggerDagRunLink()
|
||||
51 51 |
|
||||
|
||||
AIR302_standard.py:54:1: AIR302 [*] `airflow.sensors.external_task.ExternalTaskSensorLink` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.external_task.ExternalTaskSensorLink` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:54:1
|
||||
|
|
||||
52 | from airflow.sensors.external_task import ExternalTaskSensorLink
|
||||
53 |
|
||||
54 | ExternalTaskSensorLink()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
55 |
|
||||
56 | from airflow.sensors.time_delta import WaitSensor
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalDagLink` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalDagLink` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
50 50 | TriggerDagRunLink()
|
||||
@@ -365,16 +380,17 @@ AIR302_standard.py:54:1: AIR302 [*] `airflow.sensors.external_task.ExternalTaskS
|
||||
56 57 | from airflow.sensors.time_delta import WaitSensor
|
||||
57 58 |
|
||||
|
||||
AIR302_standard.py:58:1: AIR302 [*] `airflow.sensors.time_delta.WaitSensor` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.time_delta.WaitSensor` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:58:1
|
||||
|
|
||||
56 | from airflow.sensors.time_delta import WaitSensor
|
||||
57 |
|
||||
58 | WaitSensor()
|
||||
| ^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^
|
||||
59 |
|
||||
60 | from airflow.operators.dummy import DummyOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `WaitSensor` from `airflow.providers.standard.sensors.time_delta` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `WaitSensor` from `airflow.providers.standard.sensors.time_delta` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
53 53 |
|
||||
@@ -386,16 +402,17 @@ AIR302_standard.py:58:1: AIR302 [*] `airflow.sensors.time_delta.WaitSensor` is m
|
||||
58 58 | WaitSensor()
|
||||
59 59 |
|
||||
|
||||
AIR302_standard.py:62:1: AIR302 [*] `airflow.operators.dummy.DummyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.dummy.DummyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:62:1
|
||||
|
|
||||
60 | from airflow.operators.dummy import DummyOperator
|
||||
61 |
|
||||
62 | DummyOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
63 |
|
||||
64 | from airflow.operators.dummy import EmptyOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
58 58 | WaitSensor()
|
||||
@@ -409,16 +426,17 @@ AIR302_standard.py:62:1: AIR302 [*] `airflow.operators.dummy.DummyOperator` is m
|
||||
64 65 | from airflow.operators.dummy import EmptyOperator
|
||||
65 66 |
|
||||
|
||||
AIR302_standard.py:66:1: AIR302 [*] `airflow.operators.dummy.EmptyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.dummy.EmptyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:66:1
|
||||
|
|
||||
64 | from airflow.operators.dummy import EmptyOperator
|
||||
65 |
|
||||
66 | EmptyOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
67 |
|
||||
68 | from airflow.operators.dummy_operator import DummyOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
61 61 |
|
||||
@@ -430,16 +448,17 @@ AIR302_standard.py:66:1: AIR302 [*] `airflow.operators.dummy.EmptyOperator` is m
|
||||
66 66 | EmptyOperator()
|
||||
67 67 |
|
||||
|
||||
AIR302_standard.py:70:1: AIR302 [*] `airflow.operators.dummy_operator.DummyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.dummy_operator.DummyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:70:1
|
||||
|
|
||||
68 | from airflow.operators.dummy_operator import DummyOperator
|
||||
69 |
|
||||
70 | DummyOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
71 |
|
||||
72 | from airflow.operators.dummy_operator import EmptyOperator
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
66 66 | EmptyOperator()
|
||||
@@ -450,16 +469,17 @@ AIR302_standard.py:70:1: AIR302 [*] `airflow.operators.dummy_operator.DummyOpera
|
||||
70 71 | DummyOperator()
|
||||
71 72 |
|
||||
|
||||
AIR302_standard.py:74:1: AIR302 [*] `airflow.operators.dummy_operator.EmptyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.operators.dummy_operator.EmptyOperator` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:74:1
|
||||
|
|
||||
72 | from airflow.operators.dummy_operator import EmptyOperator
|
||||
73 |
|
||||
74 | EmptyOperator()
|
||||
| ^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^
|
||||
75 |
|
||||
76 | from airflow.sensors.external_task_sensor import ExternalTaskSensorLink
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
69 69 |
|
||||
@@ -471,14 +491,15 @@ AIR302_standard.py:74:1: AIR302 [*] `airflow.operators.dummy_operator.EmptyOpera
|
||||
74 74 | EmptyOperator()
|
||||
75 75 |
|
||||
|
||||
AIR302_standard.py:78:1: AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is moved into `standard` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is moved into `standard` provider in Airflow 3.0;
|
||||
--> AIR302_standard.py:78:1
|
||||
|
|
||||
76 | from airflow.sensors.external_task_sensor import ExternalTaskSensorLink
|
||||
77 |
|
||||
78 | ExternalTaskSensorLink()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalDagLink` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalDagLink` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
74 74 | EmptyOperator()
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR302_zendesk.py:5:1: AIR302 [*] `airflow.hooks.zendesk_hook.ZendeskHook` is moved into `zendesk` provider in Airflow 3.0;
|
||||
AIR302 [*] `airflow.hooks.zendesk_hook.ZendeskHook` is moved into `zendesk` provider in Airflow 3.0;
|
||||
--> AIR302_zendesk.py:5:1
|
||||
|
|
||||
3 | from airflow.hooks.zendesk_hook import ZendeskHook
|
||||
4 |
|
||||
5 | ZendeskHook()
|
||||
| ^^^^^^^^^^^ AIR302
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-zendesk>=1.0.0` and use `ZendeskHook` from `airflow.providers.zendesk.hooks.zendesk` instead.
|
||||
help: Install `apache-airflow-providers-zendesk>=1.0.0` and use `ZendeskHook` from `airflow.providers.zendesk.hooks.zendesk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR311_args.py:13:34: AIR311 `sla_miss_callback` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 `sla_miss_callback` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_args.py:13:34
|
||||
|
|
||||
13 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback)
|
||||
| ^^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
AIR311_args.py:16:6: AIR311 `sla_miss_callback` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 `sla_miss_callback` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_args.py:16:6
|
||||
|
|
||||
16 | @dag(sla_miss_callback=sla_callback)
|
||||
| ^^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
17 | def decorator_sla_callback():
|
||||
18 | pass
|
||||
|
|
||||
|
||||
AIR311_args.py:25:9: AIR311 `sla` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 `sla` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_args.py:25:9
|
||||
|
|
||||
23 | branch_dt_op2 = BranchDateTimeOperator(
|
||||
24 | task_id="branch_dt_op2",
|
||||
25 | sla=timedelta(seconds=10),
|
||||
| ^^^ AIR311
|
||||
| ^^^
|
||||
26 | )
|
||||
|
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR311_names.py:20:1: AIR311 [*] `airflow.Dataset` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.Dataset` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:20:1
|
||||
|
|
||||
19 | # airflow
|
||||
20 | DatasetFromRoot()
|
||||
| ^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^
|
||||
21 |
|
||||
22 | # airflow.datasets
|
||||
|
|
||||
= help: Use `Asset` from `airflow.sdk` instead.
|
||||
help: Use `Asset` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
15 15 | task,
|
||||
@@ -24,15 +25,16 @@ AIR311_names.py:20:1: AIR311 [*] `airflow.Dataset` is removed in Airflow 3.0; It
|
||||
22 23 | # airflow.datasets
|
||||
23 24 | Dataset()
|
||||
|
||||
AIR311_names.py:23:1: AIR311 [*] `airflow.datasets.Dataset` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.datasets.Dataset` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:23:1
|
||||
|
|
||||
22 | # airflow.datasets
|
||||
23 | Dataset()
|
||||
| ^^^^^^^ AIR311
|
||||
| ^^^^^^^
|
||||
24 | DatasetAlias()
|
||||
25 | DatasetAll()
|
||||
|
|
||||
= help: Use `Asset` from `airflow.sdk` instead.
|
||||
help: Use `Asset` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
15 15 | task,
|
||||
@@ -50,16 +52,17 @@ AIR311_names.py:23:1: AIR311 [*] `airflow.datasets.Dataset` is removed in Airflo
|
||||
25 26 | DatasetAll()
|
||||
26 27 | DatasetAny()
|
||||
|
||||
AIR311_names.py:24:1: AIR311 [*] `airflow.datasets.DatasetAlias` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.datasets.DatasetAlias` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:24:1
|
||||
|
|
||||
22 | # airflow.datasets
|
||||
23 | Dataset()
|
||||
24 | DatasetAlias()
|
||||
| ^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^
|
||||
25 | DatasetAll()
|
||||
26 | DatasetAny()
|
||||
|
|
||||
= help: Use `AssetAlias` from `airflow.sdk` instead.
|
||||
help: Use `AssetAlias` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
15 15 | task,
|
||||
@@ -78,16 +81,17 @@ AIR311_names.py:24:1: AIR311 [*] `airflow.datasets.DatasetAlias` is removed in A
|
||||
26 27 | DatasetAny()
|
||||
27 28 | Metadata()
|
||||
|
||||
AIR311_names.py:25:1: AIR311 [*] `airflow.datasets.DatasetAll` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.datasets.DatasetAll` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:25:1
|
||||
|
|
||||
23 | Dataset()
|
||||
24 | DatasetAlias()
|
||||
25 | DatasetAll()
|
||||
| ^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^
|
||||
26 | DatasetAny()
|
||||
27 | Metadata()
|
||||
|
|
||||
= help: Use `AssetAll` from `airflow.sdk` instead.
|
||||
help: Use `AssetAll` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
15 15 | task,
|
||||
@@ -107,16 +111,17 @@ AIR311_names.py:25:1: AIR311 [*] `airflow.datasets.DatasetAll` is removed in Air
|
||||
27 28 | Metadata()
|
||||
28 29 | expand_alias_to_datasets()
|
||||
|
||||
AIR311_names.py:26:1: AIR311 [*] `airflow.datasets.DatasetAny` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.datasets.DatasetAny` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:26:1
|
||||
|
|
||||
24 | DatasetAlias()
|
||||
25 | DatasetAll()
|
||||
26 | DatasetAny()
|
||||
| ^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^
|
||||
27 | Metadata()
|
||||
28 | expand_alias_to_datasets()
|
||||
|
|
||||
= help: Use `AssetAny` from `airflow.sdk` instead.
|
||||
help: Use `AssetAny` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
15 15 | task,
|
||||
@@ -136,15 +141,16 @@ AIR311_names.py:26:1: AIR311 [*] `airflow.datasets.DatasetAny` is removed in Air
|
||||
28 29 | expand_alias_to_datasets()
|
||||
29 30 |
|
||||
|
||||
AIR311_names.py:27:1: AIR311 [*] `airflow.datasets.metadata.Metadata` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.datasets.metadata.Metadata` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:27:1
|
||||
|
|
||||
25 | DatasetAll()
|
||||
26 | DatasetAny()
|
||||
27 | Metadata()
|
||||
| ^^^^^^^^ AIR311
|
||||
| ^^^^^^^^
|
||||
28 | expand_alias_to_datasets()
|
||||
|
|
||||
= help: Use `Metadata` from `airflow.sdk` instead.
|
||||
help: Use `Metadata` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
8 8 | DatasetAny,
|
||||
@@ -162,16 +168,17 @@ AIR311_names.py:27:1: AIR311 [*] `airflow.datasets.metadata.Metadata` is removed
|
||||
19 19 | # airflow
|
||||
20 20 | DatasetFromRoot()
|
||||
|
||||
AIR311_names.py:28:1: AIR311 [*] `airflow.datasets.expand_alias_to_datasets` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.datasets.expand_alias_to_datasets` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:28:1
|
||||
|
|
||||
26 | DatasetAny()
|
||||
27 | Metadata()
|
||||
28 | expand_alias_to_datasets()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
29 |
|
||||
30 | # airflow.decorators
|
||||
|
|
||||
= help: Use `expand_alias_to_assets` from `airflow.models.asset` instead.
|
||||
help: Use `expand_alias_to_assets` from `airflow.models.asset` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
15 15 | task,
|
||||
@@ -191,15 +198,16 @@ AIR311_names.py:28:1: AIR311 [*] `airflow.datasets.expand_alias_to_datasets` is
|
||||
30 31 | # airflow.decorators
|
||||
31 32 | dag()
|
||||
|
||||
AIR311_names.py:31:1: AIR311 [*] `airflow.decorators.dag` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.decorators.dag` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:31:1
|
||||
|
|
||||
30 | # airflow.decorators
|
||||
31 | dag()
|
||||
| ^^^ AIR311
|
||||
| ^^^
|
||||
32 | task()
|
||||
33 | task_group()
|
||||
|
|
||||
= help: Use `dag` from `airflow.sdk` instead.
|
||||
help: Use `dag` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
10 10 | )
|
||||
@@ -215,16 +223,17 @@ AIR311_names.py:31:1: AIR311 [*] `airflow.decorators.dag` is removed in Airflow
|
||||
19 19 | # airflow
|
||||
20 20 | DatasetFromRoot()
|
||||
|
||||
AIR311_names.py:32:1: AIR311 [*] `airflow.decorators.task` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.decorators.task` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:32:1
|
||||
|
|
||||
30 | # airflow.decorators
|
||||
31 | dag()
|
||||
32 | task()
|
||||
| ^^^^ AIR311
|
||||
| ^^^^
|
||||
33 | task_group()
|
||||
34 | setup()
|
||||
|
|
||||
= help: Use `task` from `airflow.sdk` instead.
|
||||
help: Use `task` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | from airflow.decorators import (
|
||||
@@ -238,16 +247,17 @@ AIR311_names.py:32:1: AIR311 [*] `airflow.decorators.task` is removed in Airflow
|
||||
19 19 | # airflow
|
||||
20 20 | DatasetFromRoot()
|
||||
|
||||
AIR311_names.py:33:1: AIR311 [*] `airflow.decorators.task_group` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.decorators.task_group` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:33:1
|
||||
|
|
||||
31 | dag()
|
||||
32 | task()
|
||||
33 | task_group()
|
||||
| ^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^
|
||||
34 | setup()
|
||||
35 | from airflow.decorators import teardown
|
||||
|
|
||||
= help: Use `task_group` from `airflow.sdk` instead.
|
||||
help: Use `task_group` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
13 13 | dag,
|
||||
@@ -260,16 +270,17 @@ AIR311_names.py:33:1: AIR311 [*] `airflow.decorators.task_group` is removed in A
|
||||
19 19 | # airflow
|
||||
20 20 | DatasetFromRoot()
|
||||
|
||||
AIR311_names.py:34:1: AIR311 [*] `airflow.decorators.setup` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.decorators.setup` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:34:1
|
||||
|
|
||||
32 | task()
|
||||
33 | task_group()
|
||||
34 | setup()
|
||||
| ^^^^^ AIR311
|
||||
| ^^^^^
|
||||
35 | from airflow.decorators import teardown
|
||||
36 | from airflow.io.path import ObjectStoragePath
|
||||
|
|
||||
= help: Use `setup` from `airflow.sdk` instead.
|
||||
help: Use `setup` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
11 11 | from airflow.datasets.metadata import Metadata
|
||||
@@ -284,15 +295,16 @@ AIR311_names.py:34:1: AIR311 [*] `airflow.decorators.setup` is removed in Airflo
|
||||
19 19 | # airflow
|
||||
20 20 | DatasetFromRoot()
|
||||
|
||||
AIR311_names.py:48:1: AIR311 [*] `airflow.decorators.teardown` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.decorators.teardown` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:48:1
|
||||
|
|
||||
47 | # airflow.decorators
|
||||
48 | teardown()
|
||||
| ^^^^^^^^ AIR311
|
||||
| ^^^^^^^^
|
||||
49 |
|
||||
50 | # # airflow.io
|
||||
|
|
||||
= help: Use `teardown` from `airflow.sdk` instead.
|
||||
help: Use `teardown` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
32 32 | task()
|
||||
@@ -311,14 +323,15 @@ AIR311_names.py:48:1: AIR311 [*] `airflow.decorators.teardown` is removed in Air
|
||||
47 47 | # airflow.decorators
|
||||
48 48 | teardown()
|
||||
|
||||
AIR311_names.py:51:1: AIR311 [*] `airflow.io.path.ObjectStoragePath` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.io.path.ObjectStoragePath` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:51:1
|
||||
|
|
||||
50 | # # airflow.io
|
||||
51 | ObjectStoragePath()
|
||||
| ^^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
52 | attach()
|
||||
|
|
||||
= help: Use `ObjectStoragePath` from `airflow.sdk` instead.
|
||||
help: Use `ObjectStoragePath` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
33 33 | task_group()
|
||||
@@ -337,16 +350,17 @@ AIR311_names.py:51:1: AIR311 [*] `airflow.io.path.ObjectStoragePath` is removed
|
||||
47 47 | # airflow.decorators
|
||||
48 48 | teardown()
|
||||
|
||||
AIR311_names.py:52:1: AIR311 [*] `airflow.io.storage.attach` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.io.storage.attach` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:52:1
|
||||
|
|
||||
50 | # # airflow.io
|
||||
51 | ObjectStoragePath()
|
||||
52 | attach()
|
||||
| ^^^^^^ AIR311
|
||||
| ^^^^^^
|
||||
53 |
|
||||
54 | # airflow.models
|
||||
|
|
||||
= help: Use `attach` from `airflow.sdk.io` instead.
|
||||
help: Use `attach` from `airflow.sdk.io` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
34 34 | setup()
|
||||
@@ -365,15 +379,16 @@ AIR311_names.py:52:1: AIR311 [*] `airflow.io.storage.attach` is removed in Airfl
|
||||
47 47 | # airflow.decorators
|
||||
48 48 | teardown()
|
||||
|
||||
AIR311_names.py:55:1: AIR311 [*] `airflow.models.Connection` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.Connection` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:55:1
|
||||
|
|
||||
54 | # airflow.models
|
||||
55 | Connection()
|
||||
| ^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^
|
||||
56 | DAGFromModel()
|
||||
57 | Variable()
|
||||
|
|
||||
= help: Use `Connection` from `airflow.sdk` instead.
|
||||
help: Use `Connection` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
37 37 | from airflow.io.storage import attach
|
||||
@@ -390,15 +405,16 @@ AIR311_names.py:55:1: AIR311 [*] `airflow.models.Connection` is removed in Airfl
|
||||
47 47 | # airflow.decorators
|
||||
48 48 | teardown()
|
||||
|
||||
AIR311_names.py:56:1: AIR311 [*] `airflow.models.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:56:1
|
||||
|
|
||||
54 | # airflow.models
|
||||
55 | Connection()
|
||||
56 | DAGFromModel()
|
||||
| ^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^
|
||||
57 | Variable()
|
||||
|
|
||||
= help: Use `DAG` from `airflow.sdk` instead.
|
||||
help: Use `DAG` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
43 43 | from airflow.models.baseoperator import chain, chain_linear, cross_downstream
|
||||
@@ -418,16 +434,17 @@ AIR311_names.py:56:1: AIR311 [*] `airflow.models.DAG` is removed in Airflow 3.0;
|
||||
58 59 |
|
||||
59 60 | # airflow.models.baseoperator
|
||||
|
||||
AIR311_names.py:57:1: AIR311 [*] `airflow.models.Variable` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.Variable` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:57:1
|
||||
|
|
||||
55 | Connection()
|
||||
56 | DAGFromModel()
|
||||
57 | Variable()
|
||||
| ^^^^^^^^ AIR311
|
||||
| ^^^^^^^^
|
||||
58 |
|
||||
59 | # airflow.models.baseoperator
|
||||
|
|
||||
= help: Use `Variable` from `airflow.sdk` instead.
|
||||
help: Use `Variable` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
38 38 | from airflow.models import DAG as DAGFromModel
|
||||
@@ -443,15 +460,16 @@ AIR311_names.py:57:1: AIR311 [*] `airflow.models.Variable` is removed in Airflow
|
||||
47 47 | # airflow.decorators
|
||||
48 48 | teardown()
|
||||
|
||||
AIR311_names.py:60:1: AIR311 [*] `airflow.models.baseoperator.chain` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.baseoperator.chain` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:60:1
|
||||
|
|
||||
59 | # airflow.models.baseoperator
|
||||
60 | chain()
|
||||
| ^^^^^ AIR311
|
||||
| ^^^^^
|
||||
61 | chain_linear()
|
||||
62 | cross_downstream()
|
||||
|
|
||||
= help: Use `chain` from `airflow.sdk` instead.
|
||||
help: Use `chain` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
40 40 | Connection,
|
||||
@@ -466,15 +484,16 @@ AIR311_names.py:60:1: AIR311 [*] `airflow.models.baseoperator.chain` is removed
|
||||
47 48 | # airflow.decorators
|
||||
48 49 | teardown()
|
||||
|
||||
AIR311_names.py:61:1: AIR311 [*] `airflow.models.baseoperator.chain_linear` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.baseoperator.chain_linear` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:61:1
|
||||
|
|
||||
59 | # airflow.models.baseoperator
|
||||
60 | chain()
|
||||
61 | chain_linear()
|
||||
| ^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^
|
||||
62 | cross_downstream()
|
||||
|
|
||||
= help: Use `chain_linear` from `airflow.sdk` instead.
|
||||
help: Use `chain_linear` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
40 40 | Connection,
|
||||
@@ -489,16 +508,17 @@ AIR311_names.py:61:1: AIR311 [*] `airflow.models.baseoperator.chain_linear` is r
|
||||
47 48 | # airflow.decorators
|
||||
48 49 | teardown()
|
||||
|
||||
AIR311_names.py:62:1: AIR311 [*] `airflow.models.baseoperator.cross_downstream` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.baseoperator.cross_downstream` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:62:1
|
||||
|
|
||||
60 | chain()
|
||||
61 | chain_linear()
|
||||
62 | cross_downstream()
|
||||
| ^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
63 |
|
||||
64 | # airflow.models.baseoperatolinker
|
||||
|
|
||||
= help: Use `cross_downstream` from `airflow.sdk` instead.
|
||||
help: Use `cross_downstream` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
40 40 | Connection,
|
||||
@@ -513,15 +533,16 @@ AIR311_names.py:62:1: AIR311 [*] `airflow.models.baseoperator.cross_downstream`
|
||||
47 48 | # airflow.decorators
|
||||
48 49 | teardown()
|
||||
|
||||
AIR311_names.py:65:1: AIR311 [*] `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:65:1
|
||||
|
|
||||
64 | # airflow.models.baseoperatolinker
|
||||
65 | BaseOperatorLink()
|
||||
| ^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
66 |
|
||||
67 | # airflow.models.dag
|
||||
|
|
||||
= help: Use `BaseOperatorLink` from `airflow.sdk` instead.
|
||||
help: Use `BaseOperatorLink` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
41 41 | Variable,
|
||||
@@ -534,15 +555,16 @@ AIR311_names.py:65:1: AIR311 [*] `airflow.models.baseoperatorlink.BaseOperatorLi
|
||||
47 47 | # airflow.decorators
|
||||
48 48 | teardown()
|
||||
|
||||
AIR311_names.py:68:1: AIR311 [*] `airflow.models.dag.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.models.dag.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:68:1
|
||||
|
|
||||
67 | # airflow.models.dag
|
||||
68 | DAGFromDag()
|
||||
| ^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^
|
||||
69 | from airflow.timetables.datasets import DatasetOrTimeSchedule
|
||||
70 | from airflow.utils.dag_parsing_context import get_parsing_context
|
||||
|
|
||||
= help: Use `DAG` from `airflow.sdk` instead.
|
||||
help: Use `DAG` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
43 43 | from airflow.models.baseoperator import chain, chain_linear, cross_downstream
|
||||
@@ -562,15 +584,16 @@ AIR311_names.py:68:1: AIR311 [*] `airflow.models.dag.DAG` is removed in Airflow
|
||||
70 71 | from airflow.utils.dag_parsing_context import get_parsing_context
|
||||
71 72 |
|
||||
|
||||
AIR311_names.py:73:1: AIR311 [*] `airflow.timetables.datasets.DatasetOrTimeSchedule` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.timetables.datasets.DatasetOrTimeSchedule` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:73:1
|
||||
|
|
||||
72 | # airflow.timetables.datasets
|
||||
73 | DatasetOrTimeSchedule()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
74 |
|
||||
75 | # airflow.utils.dag_parsing_context
|
||||
|
|
||||
= help: Use `AssetOrTimeSchedule` from `airflow.timetables.assets` instead.
|
||||
help: Use `AssetOrTimeSchedule` from `airflow.timetables.assets` instead.
|
||||
|
||||
ℹ Safe fix
|
||||
68 68 | DAGFromDag()
|
||||
@@ -585,13 +608,14 @@ AIR311_names.py:73:1: AIR311 [*] `airflow.timetables.datasets.DatasetOrTimeSched
|
||||
75 76 | # airflow.utils.dag_parsing_context
|
||||
76 77 | get_parsing_context()
|
||||
|
||||
AIR311_names.py:76:1: AIR311 [*] `airflow.utils.dag_parsing_context.get_parsing_context` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR311 [*] `airflow.utils.dag_parsing_context.get_parsing_context` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR311_names.py:76:1
|
||||
|
|
||||
75 | # airflow.utils.dag_parsing_context
|
||||
76 | get_parsing_context()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR311
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Use `get_parsing_context` from `airflow.sdk` instead.
|
||||
help: Use `get_parsing_context` from `airflow.sdk` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
67 67 | # airflow.models.dag
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/airflow/mod.rs
|
||||
---
|
||||
AIR312.py:14:1: AIR312 [*] `airflow.hooks.filesystem.FSHook` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.hooks.filesystem.FSHook` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:14:1
|
||||
|
|
||||
12 | from airflow.sensors.date_time import DateTimeSensor
|
||||
13 |
|
||||
14 | FSHook()
|
||||
| ^^^^^^ AIR312
|
||||
| ^^^^^^
|
||||
15 | PackageIndexHook()
|
||||
16 | SubprocessHook()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `FSHook` from `airflow.providers.standard.hooks.filesystem` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `FSHook` from `airflow.providers.standard.hooks.filesystem` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -28,14 +29,15 @@ AIR312.py:14:1: AIR312 [*] `airflow.hooks.filesystem.FSHook` is deprecated and m
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:15:1: AIR312 [*] `airflow.hooks.package_index.PackageIndexHook` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.hooks.package_index.PackageIndexHook` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:15:1
|
||||
|
|
||||
14 | FSHook()
|
||||
15 | PackageIndexHook()
|
||||
| ^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
16 | SubprocessHook()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `PackageIndexHook` from `airflow.providers.standard.hooks.package_index` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `PackageIndexHook` from `airflow.providers.standard.hooks.package_index` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
1 1 | from __future__ import annotations
|
||||
@@ -54,16 +56,17 @@ AIR312.py:15:1: AIR312 [*] `airflow.hooks.package_index.PackageIndexHook` is dep
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:16:1: AIR312 [*] `airflow.hooks.subprocess.SubprocessHook` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.hooks.subprocess.SubprocessHook` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:16:1
|
||||
|
|
||||
14 | FSHook()
|
||||
15 | PackageIndexHook()
|
||||
16 | SubprocessHook()
|
||||
| ^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^
|
||||
17 |
|
||||
18 | BashOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `SubprocessHook` from `airflow.providers.standard.hooks.subprocess` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `SubprocessHook` from `airflow.providers.standard.hooks.subprocess` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 |
|
||||
@@ -82,16 +85,17 @@ AIR312.py:16:1: AIR312 [*] `airflow.hooks.subprocess.SubprocessHook` is deprecat
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:18:1: AIR312 [*] `airflow.operators.bash.BashOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.bash.BashOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:18:1
|
||||
|
|
||||
16 | SubprocessHook()
|
||||
17 |
|
||||
18 | BashOperator()
|
||||
| ^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^
|
||||
19 | BranchDateTimeOperator()
|
||||
20 | TriggerDagRunOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `BashOperator` from `airflow.providers.standard.operators.bash` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BashOperator` from `airflow.providers.standard.operators.bash` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
3 3 | from airflow.hooks.filesystem import FSHook
|
||||
@@ -109,15 +113,16 @@ AIR312.py:18:1: AIR312 [*] `airflow.operators.bash.BashOperator` is deprecated a
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:19:1: AIR312 [*] `airflow.operators.datetime.BranchDateTimeOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.datetime.BranchDateTimeOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:19:1
|
||||
|
|
||||
18 | BashOperator()
|
||||
19 | BranchDateTimeOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
20 | TriggerDagRunOperator()
|
||||
21 | EmptyOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchDateTimeOperator` from `airflow.providers.standard.operators.datetime` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchDateTimeOperator` from `airflow.providers.standard.operators.datetime` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
4 4 | from airflow.hooks.package_index import PackageIndexHook
|
||||
@@ -134,15 +139,16 @@ AIR312.py:19:1: AIR312 [*] `airflow.operators.datetime.BranchDateTimeOperator` i
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:20:1: AIR312 [*] `airflow.operators.trigger_dagrun.TriggerDagRunOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.trigger_dagrun.TriggerDagRunOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:20:1
|
||||
|
|
||||
18 | BashOperator()
|
||||
19 | BranchDateTimeOperator()
|
||||
20 | TriggerDagRunOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
21 | EmptyOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunOperator` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunOperator` from `airflow.providers.standard.operators.trigger_dagrun` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
7 7 | from airflow.operators.datetime import BranchDateTimeOperator
|
||||
@@ -156,16 +162,17 @@ AIR312.py:20:1: AIR312 [*] `airflow.operators.trigger_dagrun.TriggerDagRunOperat
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:21:1: AIR312 [*] `airflow.operators.empty.EmptyOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.empty.EmptyOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:21:1
|
||||
|
|
||||
19 | BranchDateTimeOperator()
|
||||
20 | TriggerDagRunOperator()
|
||||
21 | EmptyOperator()
|
||||
| ^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^
|
||||
22 |
|
||||
23 | LatestOnlyOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `EmptyOperator` from `airflow.providers.standard.operators.empty` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
5 5 | from airflow.hooks.subprocess import SubprocessHook
|
||||
@@ -181,16 +188,17 @@ AIR312.py:21:1: AIR312 [*] `airflow.operators.empty.EmptyOperator` is deprecated
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:23:1: AIR312 [*] `airflow.operators.latest_only.LatestOnlyOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.latest_only.LatestOnlyOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:23:1
|
||||
|
|
||||
21 | EmptyOperator()
|
||||
22 |
|
||||
23 | LatestOnlyOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
24 | BranchDayOfWeekOperator()
|
||||
25 | DateTimeSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `LatestOnlyOperator` from `airflow.providers.standard.operators.latest_only` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `LatestOnlyOperator` from `airflow.providers.standard.operators.latest_only` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
6 6 | from airflow.operators.bash import BashOperator
|
||||
@@ -205,14 +213,15 @@ AIR312.py:23:1: AIR312 [*] `airflow.operators.latest_only.LatestOnlyOperator` is
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:24:1: AIR312 [*] `airflow.operators.weekday.BranchDayOfWeekOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.weekday.BranchDayOfWeekOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:24:1
|
||||
|
|
||||
23 | LatestOnlyOperator()
|
||||
24 | BranchDayOfWeekOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
25 | DateTimeSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchDayOfWeekOperator` from `airflow.providers.standard.operators.weekday` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchDayOfWeekOperator` from `airflow.providers.standard.operators.weekday` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
8 8 | from airflow.operators.empty import EmptyOperator
|
||||
@@ -225,16 +234,17 @@ AIR312.py:24:1: AIR312 [*] `airflow.operators.weekday.BranchDayOfWeekOperator` i
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:25:1: AIR312 [*] `airflow.sensors.date_time.DateTimeSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.date_time.DateTimeSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:25:1
|
||||
|
|
||||
23 | LatestOnlyOperator()
|
||||
24 | BranchDayOfWeekOperator()
|
||||
25 | DateTimeSensor()
|
||||
| ^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^
|
||||
26 |
|
||||
27 | from airflow.operators.python import (
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `DateTimeSensor` from `airflow.providers.standard.sensors.date_time` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `DateTimeSensor` from `airflow.providers.standard.sensors.date_time` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
9 9 | from airflow.operators.latest_only import LatestOnlyOperator
|
||||
@@ -246,16 +256,17 @@ AIR312.py:25:1: AIR312 [*] `airflow.sensors.date_time.DateTimeSensor` is depreca
|
||||
14 14 | FSHook()
|
||||
15 15 | PackageIndexHook()
|
||||
|
||||
AIR312.py:44:1: AIR312 [*] `airflow.operators.python.BranchPythonOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.python.BranchPythonOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:44:1
|
||||
|
|
||||
42 | from airflow.sensors.filesystem import FileSensor
|
||||
43 |
|
||||
44 | BranchPythonOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
45 | PythonOperator()
|
||||
46 | PythonVirtualenvOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchPythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchPythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
25 25 | DateTimeSensor()
|
||||
@@ -274,15 +285,16 @@ AIR312.py:44:1: AIR312 [*] `airflow.operators.python.BranchPythonOperator` is de
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:45:1: AIR312 [*] `airflow.operators.python.PythonOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.python.PythonOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:45:1
|
||||
|
|
||||
44 | BranchPythonOperator()
|
||||
45 | PythonOperator()
|
||||
| ^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^
|
||||
46 | PythonVirtualenvOperator()
|
||||
47 | ShortCircuitOperator()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
26 26 |
|
||||
@@ -301,16 +313,17 @@ AIR312.py:45:1: AIR312 [*] `airflow.operators.python.PythonOperator` is deprecat
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:46:1: AIR312 [*] `airflow.operators.python.PythonVirtualenvOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.python.PythonVirtualenvOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:46:1
|
||||
|
|
||||
44 | BranchPythonOperator()
|
||||
45 | PythonOperator()
|
||||
46 | PythonVirtualenvOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
47 | ShortCircuitOperator()
|
||||
48 | DateTimeSensorAsync()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonVirtualenvOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonVirtualenvOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
27 27 | from airflow.operators.python import (
|
||||
@@ -329,16 +342,17 @@ AIR312.py:46:1: AIR312 [*] `airflow.operators.python.PythonVirtualenvOperator` i
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:47:1: AIR312 [*] `airflow.operators.python.ShortCircuitOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.operators.python.ShortCircuitOperator` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:47:1
|
||||
|
|
||||
45 | PythonOperator()
|
||||
46 | PythonVirtualenvOperator()
|
||||
47 | ShortCircuitOperator()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
48 | DateTimeSensorAsync()
|
||||
49 | ExternalTaskMarker()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `ShortCircuitOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `ShortCircuitOperator` from `airflow.providers.standard.operators.python` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
28 28 | BranchPythonOperator,
|
||||
@@ -357,16 +371,17 @@ AIR312.py:47:1: AIR312 [*] `airflow.operators.python.ShortCircuitOperator` is de
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:48:1: AIR312 [*] `airflow.sensors.date_time.DateTimeSensorAsync` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.date_time.DateTimeSensorAsync` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:48:1
|
||||
|
|
||||
46 | PythonVirtualenvOperator()
|
||||
47 | ShortCircuitOperator()
|
||||
48 | DateTimeSensorAsync()
|
||||
| ^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
49 | ExternalTaskMarker()
|
||||
50 | ExternalTaskSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `DateTimeSensorAsync` from `airflow.providers.standard.sensors.date_time` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `DateTimeSensorAsync` from `airflow.providers.standard.sensors.date_time` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
30 30 | PythonVirtualenvOperator,
|
||||
@@ -385,16 +400,17 @@ AIR312.py:48:1: AIR312 [*] `airflow.sensors.date_time.DateTimeSensorAsync` is de
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:49:1: AIR312 [*] `airflow.sensors.external_task.ExternalTaskMarker` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.external_task.ExternalTaskMarker` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:49:1
|
||||
|
|
||||
47 | ShortCircuitOperator()
|
||||
48 | DateTimeSensorAsync()
|
||||
49 | ExternalTaskMarker()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
50 | ExternalTaskSensor()
|
||||
51 | FileSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskMarker` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskMarker` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
32 32 | )
|
||||
@@ -413,16 +429,17 @@ AIR312.py:49:1: AIR312 [*] `airflow.sensors.external_task.ExternalTaskMarker` is
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:50:1: AIR312 [*] `airflow.sensors.external_task.ExternalTaskSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.external_task.ExternalTaskSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:50:1
|
||||
|
|
||||
48 | DateTimeSensorAsync()
|
||||
49 | ExternalTaskMarker()
|
||||
50 | ExternalTaskSensor()
|
||||
| ^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
51 | FileSensor()
|
||||
52 | TimeSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskSensor` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskSensor` from `airflow.providers.standard.sensors.external_task` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
33 33 | from airflow.sensors.date_time import DateTimeSensorAsync
|
||||
@@ -440,16 +457,17 @@ AIR312.py:50:1: AIR312 [*] `airflow.sensors.external_task.ExternalTaskSensor` is
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:51:1: AIR312 [*] `airflow.sensors.filesystem.FileSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.filesystem.FileSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:51:1
|
||||
|
|
||||
49 | ExternalTaskMarker()
|
||||
50 | ExternalTaskSensor()
|
||||
51 | FileSensor()
|
||||
| ^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^
|
||||
52 | TimeSensor()
|
||||
53 | TimeSensorAsync()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.2` and use `FileSensor` from `airflow.providers.standard.sensors.filesystem` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.2` and use `FileSensor` from `airflow.providers.standard.sensors.filesystem` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
39 39 | TimeSensor,
|
||||
@@ -461,15 +479,16 @@ AIR312.py:51:1: AIR312 [*] `airflow.sensors.filesystem.FileSensor` is deprecated
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:52:1: AIR312 [*] `airflow.sensors.time_sensor.TimeSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.time_sensor.TimeSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:52:1
|
||||
|
|
||||
50 | ExternalTaskSensor()
|
||||
51 | FileSensor()
|
||||
52 | TimeSensor()
|
||||
| ^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^
|
||||
53 | TimeSensorAsync()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeSensor` from `airflow.providers.standard.sensors.time` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeSensor` from `airflow.providers.standard.sensors.time` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
36 36 | ExternalTaskSensor,
|
||||
@@ -484,16 +503,17 @@ AIR312.py:52:1: AIR312 [*] `airflow.sensors.time_sensor.TimeSensor` is deprecate
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:53:1: AIR312 [*] `airflow.sensors.time_sensor.TimeSensorAsync` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.time_sensor.TimeSensorAsync` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:53:1
|
||||
|
|
||||
51 | FileSensor()
|
||||
52 | TimeSensor()
|
||||
53 | TimeSensorAsync()
|
||||
| ^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^
|
||||
54 |
|
||||
55 | from airflow.sensors.time_delta import (
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeSensorAsync` from `airflow.providers.standard.sensors.time` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeSensorAsync` from `airflow.providers.standard.sensors.time` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
37 37 | )
|
||||
@@ -507,16 +527,17 @@ AIR312.py:53:1: AIR312 [*] `airflow.sensors.time_sensor.TimeSensorAsync` is depr
|
||||
44 44 | BranchPythonOperator()
|
||||
45 45 | PythonOperator()
|
||||
|
||||
AIR312.py:70:1: AIR312 [*] `airflow.sensors.time_delta.TimeDeltaSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.time_delta.TimeDeltaSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:70:1
|
||||
|
|
||||
68 | )
|
||||
69 |
|
||||
70 | TimeDeltaSensor()
|
||||
| ^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^
|
||||
71 | TimeDeltaSensorAsync()
|
||||
72 | DayOfWeekSensor()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeDeltaSensor` from `airflow.providers.standard.sensors.time_delta` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeDeltaSensor` from `airflow.providers.standard.sensors.time_delta` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
53 53 | TimeSensorAsync()
|
||||
@@ -535,15 +556,16 @@ AIR312.py:70:1: AIR312 [*] `airflow.sensors.time_delta.TimeDeltaSensor` is depre
|
||||
70 70 | TimeDeltaSensor()
|
||||
71 71 | TimeDeltaSensorAsync()
|
||||
|
||||
AIR312.py:71:1: AIR312 [*] `airflow.sensors.time_delta.TimeDeltaSensorAsync` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.time_delta.TimeDeltaSensorAsync` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:71:1
|
||||
|
|
||||
70 | TimeDeltaSensor()
|
||||
71 | TimeDeltaSensorAsync()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
72 | DayOfWeekSensor()
|
||||
73 | DagStateTrigger()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeDeltaSensorAsync` from `airflow.providers.standard.sensors.time_delta` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `TimeDeltaSensorAsync` from `airflow.providers.standard.sensors.time_delta` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
54 54 |
|
||||
@@ -562,16 +584,17 @@ AIR312.py:71:1: AIR312 [*] `airflow.sensors.time_delta.TimeDeltaSensorAsync` is
|
||||
70 70 | TimeDeltaSensor()
|
||||
71 71 | TimeDeltaSensorAsync()
|
||||
|
||||
AIR312.py:72:1: AIR312 [*] `airflow.sensors.weekday.DayOfWeekSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.sensors.weekday.DayOfWeekSensor` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:72:1
|
||||
|
|
||||
70 | TimeDeltaSensor()
|
||||
71 | TimeDeltaSensorAsync()
|
||||
72 | DayOfWeekSensor()
|
||||
| ^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^
|
||||
73 | DagStateTrigger()
|
||||
74 | WorkflowTrigger()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.1` and use `DayOfWeekSensor` from `airflow.providers.standard.sensors.weekday` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.1` and use `DayOfWeekSensor` from `airflow.providers.standard.sensors.weekday` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
56 56 | TimeDeltaSensor,
|
||||
@@ -590,16 +613,17 @@ AIR312.py:72:1: AIR312 [*] `airflow.sensors.weekday.DayOfWeekSensor` is deprecat
|
||||
70 70 | TimeDeltaSensor()
|
||||
71 71 | TimeDeltaSensorAsync()
|
||||
|
||||
AIR312.py:73:1: AIR312 [*] `airflow.triggers.external_task.DagStateTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.triggers.external_task.DagStateTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:73:1
|
||||
|
|
||||
71 | TimeDeltaSensorAsync()
|
||||
72 | DayOfWeekSensor()
|
||||
73 | DagStateTrigger()
|
||||
| ^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^
|
||||
74 | WorkflowTrigger()
|
||||
75 | FileTrigger()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `DagStateTrigger` from `airflow.providers.standard.triggers.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `DagStateTrigger` from `airflow.providers.standard.triggers.external_task` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
58 58 | )
|
||||
@@ -618,16 +642,17 @@ AIR312.py:73:1: AIR312 [*] `airflow.triggers.external_task.DagStateTrigger` is d
|
||||
70 70 | TimeDeltaSensor()
|
||||
71 71 | TimeDeltaSensorAsync()
|
||||
|
||||
AIR312.py:74:1: AIR312 [*] `airflow.triggers.external_task.WorkflowTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.triggers.external_task.WorkflowTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:74:1
|
||||
|
|
||||
72 | DayOfWeekSensor()
|
||||
73 | DagStateTrigger()
|
||||
74 | WorkflowTrigger()
|
||||
| ^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^
|
||||
75 | FileTrigger()
|
||||
76 | DateTimeTrigger()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `WorkflowTrigger` from `airflow.providers.standard.triggers.external_task` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `WorkflowTrigger` from `airflow.providers.standard.triggers.external_task` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
59 59 | from airflow.sensors.weekday import DayOfWeekSensor
|
||||
@@ -645,16 +670,17 @@ AIR312.py:74:1: AIR312 [*] `airflow.triggers.external_task.WorkflowTrigger` is d
|
||||
70 70 | TimeDeltaSensor()
|
||||
71 71 | TimeDeltaSensorAsync()
|
||||
|
||||
AIR312.py:75:1: AIR312 [*] `airflow.triggers.file.FileTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.triggers.file.FileTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:75:1
|
||||
|
|
||||
73 | DagStateTrigger()
|
||||
74 | WorkflowTrigger()
|
||||
75 | FileTrigger()
|
||||
| ^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^
|
||||
76 | DateTimeTrigger()
|
||||
77 | TimeDeltaTrigger()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `FileTrigger` from `airflow.providers.standard.triggers.file` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `FileTrigger` from `airflow.providers.standard.triggers.file` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
61 61 | DagStateTrigger,
|
||||
@@ -670,15 +696,16 @@ AIR312.py:75:1: AIR312 [*] `airflow.triggers.file.FileTrigger` is deprecated and
|
||||
70 70 | TimeDeltaSensor()
|
||||
71 71 | TimeDeltaSensorAsync()
|
||||
|
||||
AIR312.py:76:1: AIR312 [*] `airflow.triggers.temporal.DateTimeTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.triggers.temporal.DateTimeTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:76:1
|
||||
|
|
||||
74 | WorkflowTrigger()
|
||||
75 | FileTrigger()
|
||||
76 | DateTimeTrigger()
|
||||
| ^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^
|
||||
77 | TimeDeltaTrigger()
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `DateTimeTrigger` from `airflow.providers.standard.triggers.temporal` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `DateTimeTrigger` from `airflow.providers.standard.triggers.temporal` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
63 63 | )
|
||||
@@ -692,14 +719,15 @@ AIR312.py:76:1: AIR312 [*] `airflow.triggers.temporal.DateTimeTrigger` is deprec
|
||||
70 70 | TimeDeltaSensor()
|
||||
71 71 | TimeDeltaSensorAsync()
|
||||
|
||||
AIR312.py:77:1: AIR312 [*] `airflow.triggers.temporal.TimeDeltaTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
AIR312 [*] `airflow.triggers.temporal.TimeDeltaTrigger` is deprecated and moved into `standard` provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
|
||||
--> AIR312.py:77:1
|
||||
|
|
||||
75 | FileTrigger()
|
||||
76 | DateTimeTrigger()
|
||||
77 | TimeDeltaTrigger()
|
||||
| ^^^^^^^^^^^^^^^^ AIR312
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Install `apache-airflow-providers-standard>=0.0.3` and use `TimeDeltaTrigger` from `airflow.providers.standard.triggers.temporal` instead.
|
||||
help: Install `apache-airflow-providers-standard>=0.0.3` and use `TimeDeltaTrigger` from `airflow.providers.standard.triggers.temporal` instead.
|
||||
|
||||
ℹ Unsafe fix
|
||||
64 64 | from airflow.triggers.file import FileTrigger
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/eradicate/mod.rs
|
||||
---
|
||||
ERA001.py:1:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:1:1
|
||||
|
|
||||
1 | #import os
|
||||
| ^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^
|
||||
2 | # from foo import junk
|
||||
3 | #a = 3
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
1 |-#import os
|
||||
@@ -16,15 +17,16 @@ ERA001.py:1:1: ERA001 Found commented-out code
|
||||
3 2 | #a = 3
|
||||
4 3 | a = 4
|
||||
|
||||
ERA001.py:2:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:2:1
|
||||
|
|
||||
1 | #import os
|
||||
2 | # from foo import junk
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 | #a = 3
|
||||
4 | a = 4
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
1 1 | #import os
|
||||
@@ -33,16 +35,17 @@ ERA001.py:2:1: ERA001 Found commented-out code
|
||||
4 3 | a = 4
|
||||
5 4 | #foo(1, 2, 3)
|
||||
|
||||
ERA001.py:3:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:3:1
|
||||
|
|
||||
1 | #import os
|
||||
2 | # from foo import junk
|
||||
3 | #a = 3
|
||||
| ^^^^^^ ERA001
|
||||
| ^^^^^^
|
||||
4 | a = 4
|
||||
5 | #foo(1, 2, 3)
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
1 1 | #import os
|
||||
@@ -52,16 +55,17 @@ ERA001.py:3:1: ERA001 Found commented-out code
|
||||
5 4 | #foo(1, 2, 3)
|
||||
6 5 |
|
||||
|
||||
ERA001.py:5:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:5:1
|
||||
|
|
||||
3 | #a = 3
|
||||
4 | a = 4
|
||||
5 | #foo(1, 2, 3)
|
||||
| ^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^
|
||||
6 |
|
||||
7 | def foo(x, y, z):
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
2 2 | # from foo import junk
|
||||
@@ -72,15 +76,16 @@ ERA001.py:5:1: ERA001 Found commented-out code
|
||||
7 6 | def foo(x, y, z):
|
||||
8 7 | content = 1 # print('hello')
|
||||
|
||||
ERA001.py:13:5: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:13:5
|
||||
|
|
||||
11 | # This is a real comment.
|
||||
12 | # # This is a (nested) comment.
|
||||
13 | #return True
|
||||
| ^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^
|
||||
14 | return False
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
10 10 |
|
||||
@@ -91,14 +96,15 @@ ERA001.py:13:5: ERA001 Found commented-out code
|
||||
15 14 |
|
||||
16 15 | #import os # noqa: ERA001
|
||||
|
||||
ERA001.py:21:5: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:21:5
|
||||
|
|
||||
19 | class A():
|
||||
20 | pass
|
||||
21 | # b = c
|
||||
| ^^^^^^^ ERA001
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
18 18 |
|
||||
@@ -109,16 +115,17 @@ ERA001.py:21:5: ERA001 Found commented-out code
|
||||
23 22 |
|
||||
24 23 | dictionary = {
|
||||
|
||||
ERA001.py:26:5: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:26:5
|
||||
|
|
||||
24 | dictionary = {
|
||||
25 | # "key1": 123, # noqa: ERA001
|
||||
26 | # "key2": 456,
|
||||
| ^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^
|
||||
27 | # "key3": 789, # test
|
||||
28 | }
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
23 23 |
|
||||
@@ -129,15 +136,16 @@ ERA001.py:26:5: ERA001 Found commented-out code
|
||||
28 27 | }
|
||||
29 28 |
|
||||
|
||||
ERA001.py:27:5: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:27:5
|
||||
|
|
||||
25 | # "key1": 123, # noqa: ERA001
|
||||
26 | # "key2": 456,
|
||||
27 | # "key3": 789, # test
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
28 | }
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
24 24 | dictionary = {
|
||||
@@ -148,16 +156,17 @@ ERA001.py:27:5: ERA001 Found commented-out code
|
||||
29 28 |
|
||||
30 29 | #import os # noqa
|
||||
|
||||
ERA001.py:32:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:32:1
|
||||
|
|
||||
30 | #import os # noqa
|
||||
31 |
|
||||
32 | # case 1:
|
||||
| ^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^
|
||||
33 | # try:
|
||||
34 | # try: # with comment
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
29 29 |
|
||||
@@ -168,15 +177,16 @@ ERA001.py:32:1: ERA001 Found commented-out code
|
||||
34 33 | # try: # with comment
|
||||
35 34 | # try: print()
|
||||
|
||||
ERA001.py:33:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:33:1
|
||||
|
|
||||
32 | # case 1:
|
||||
33 | # try:
|
||||
| ^^^^^^ ERA001
|
||||
| ^^^^^^
|
||||
34 | # try: # with comment
|
||||
35 | # try: print()
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
30 30 | #import os # noqa
|
||||
@@ -187,16 +197,17 @@ ERA001.py:33:1: ERA001 Found commented-out code
|
||||
35 34 | # try: print()
|
||||
36 35 | # except:
|
||||
|
||||
ERA001.py:34:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:34:1
|
||||
|
|
||||
32 | # case 1:
|
||||
33 | # try:
|
||||
34 | # try: # with comment
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
35 | # try: print()
|
||||
36 | # except:
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
31 31 |
|
||||
@@ -207,16 +218,17 @@ ERA001.py:34:1: ERA001 Found commented-out code
|
||||
36 35 | # except:
|
||||
37 36 | # except Foo:
|
||||
|
||||
ERA001.py:35:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:35:1
|
||||
|
|
||||
33 | # try:
|
||||
34 | # try: # with comment
|
||||
35 | # try: print()
|
||||
| ^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^
|
||||
36 | # except:
|
||||
37 | # except Foo:
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
32 32 | # case 1:
|
||||
@@ -227,16 +239,17 @@ ERA001.py:35:1: ERA001 Found commented-out code
|
||||
37 36 | # except Foo:
|
||||
38 37 | # except Exception as e: print(e)
|
||||
|
||||
ERA001.py:36:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:36:1
|
||||
|
|
||||
34 | # try: # with comment
|
||||
35 | # try: print()
|
||||
36 | # except:
|
||||
| ^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^
|
||||
37 | # except Foo:
|
||||
38 | # except Exception as e: print(e)
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
33 33 | # try:
|
||||
@@ -247,15 +260,16 @@ ERA001.py:36:1: ERA001 Found commented-out code
|
||||
38 37 | # except Exception as e: print(e)
|
||||
39 38 |
|
||||
|
||||
ERA001.py:37:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:37:1
|
||||
|
|
||||
35 | # try: print()
|
||||
36 | # except:
|
||||
37 | # except Foo:
|
||||
| ^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^
|
||||
38 | # except Exception as e: print(e)
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
34 34 | # try: # with comment
|
||||
@@ -266,14 +280,15 @@ ERA001.py:37:1: ERA001 Found commented-out code
|
||||
39 38 |
|
||||
40 39 |
|
||||
|
||||
ERA001.py:38:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:38:1
|
||||
|
|
||||
36 | # except:
|
||||
37 | # except Foo:
|
||||
38 | # except Exception as e: print(e)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
35 35 | # try: print()
|
||||
@@ -284,15 +299,16 @@ ERA001.py:38:1: ERA001 Found commented-out code
|
||||
40 39 |
|
||||
41 40 | # Script tag without an opening tag (Error)
|
||||
|
||||
ERA001.py:44:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:44:1
|
||||
|
|
||||
43 | # requires-python = ">=3.11"
|
||||
44 | # dependencies = [
|
||||
| ^^^^^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
45 | # "requests<3",
|
||||
46 | # "rich",
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
41 41 | # Script tag without an opening tag (Error)
|
||||
@@ -303,15 +319,16 @@ ERA001.py:44:1: ERA001 Found commented-out code
|
||||
46 45 | # "rich",
|
||||
47 46 | # ]
|
||||
|
||||
ERA001.py:47:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:47:1
|
||||
|
|
||||
45 | # "requests<3",
|
||||
46 | # "rich",
|
||||
47 | # ]
|
||||
| ^^^ ERA001
|
||||
| ^^^
|
||||
48 | # ///
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
44 44 | # dependencies = [
|
||||
@@ -322,16 +339,17 @@ ERA001.py:47:1: ERA001 Found commented-out code
|
||||
49 48 |
|
||||
50 49 | # Script tag (OK)
|
||||
|
||||
ERA001.py:75:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:75:1
|
||||
|
|
||||
73 | # /// script
|
||||
74 | # requires-python = ">=3.11"
|
||||
75 | # dependencies = [
|
||||
| ^^^^^^^^^^^^^^^^^^ ERA001
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
76 | # "requests<3",
|
||||
77 | # "rich",
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
72 72 |
|
||||
@@ -342,16 +360,17 @@ ERA001.py:75:1: ERA001 Found commented-out code
|
||||
77 76 | # "rich",
|
||||
78 77 | # ]
|
||||
|
||||
ERA001.py:78:1: ERA001 Found commented-out code
|
||||
ERA001 Found commented-out code
|
||||
--> ERA001.py:78:1
|
||||
|
|
||||
76 | # "requests<3",
|
||||
77 | # "rich",
|
||||
78 | # ]
|
||||
| ^^^ ERA001
|
||||
| ^^^
|
||||
79 |
|
||||
80 | # Script tag block followed by normal block (Ok)
|
||||
|
|
||||
= help: Remove commented-out code
|
||||
help: Remove commented-out code
|
||||
|
||||
ℹ Display-only fix
|
||||
75 75 | # dependencies = [
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/fastapi/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
FAST002_0.py:24:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:24:5
|
||||
|
|
||||
22 | @app.get("/items/")
|
||||
23 | def get_items(
|
||||
24 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
25 | some_security_param: str = Security(get_oauth2_user),
|
||||
26 | ):
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -31,16 +31,17 @@ FAST002_0.py:24:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
26 27 | ):
|
||||
27 28 | pass
|
||||
|
||||
FAST002_0.py:25:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:25:5
|
||||
|
|
||||
23 | def get_items(
|
||||
24 | current_user: User = Depends(get_current_user),
|
||||
25 | some_security_param: str = Security(get_oauth2_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
26 | ):
|
||||
27 | pass
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -60,16 +61,17 @@ FAST002_0.py:25:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
27 28 | pass
|
||||
28 29 |
|
||||
|
||||
FAST002_0.py:32:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:32:5
|
||||
|
|
||||
30 | @app.post("/stuff/")
|
||||
31 | def do_stuff(
|
||||
32 | some_path_param: str = Path(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -89,16 +91,17 @@ FAST002_0.py:32:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
34 35 | some_file_param: UploadFile = File(),
|
||||
35 36 | some_form_param: str = Form(),
|
||||
|
||||
FAST002_0.py:33:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:33:5
|
||||
|
|
||||
31 | def do_stuff(
|
||||
32 | some_path_param: str = Path(),
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
35 | some_form_param: str = Form(),
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -118,16 +121,17 @@ FAST002_0.py:33:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
35 36 | some_form_param: str = Form(),
|
||||
36 37 | some_query_param: str | None = Query(default=None),
|
||||
|
||||
FAST002_0.py:34:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:34:5
|
||||
|
|
||||
32 | some_path_param: str = Path(),
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
35 | some_form_param: str = Form(),
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -147,16 +151,17 @@ FAST002_0.py:34:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
36 37 | some_query_param: str | None = Query(default=None),
|
||||
37 38 | some_body_param: str = Body("foo"),
|
||||
|
||||
FAST002_0.py:35:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:35:5
|
||||
|
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
35 | some_form_param: str = Form(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -176,16 +181,17 @@ FAST002_0.py:35:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
37 38 | some_body_param: str = Body("foo"),
|
||||
38 39 | some_header_param: int = Header(default=5),
|
||||
|
||||
FAST002_0.py:36:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:36:5
|
||||
|
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
35 | some_form_param: str = Form(),
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
38 | some_header_param: int = Header(default=5),
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -205,16 +211,17 @@ FAST002_0.py:36:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
38 39 | some_header_param: int = Header(default=5),
|
||||
39 40 | ):
|
||||
|
||||
FAST002_0.py:37:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:37:5
|
||||
|
|
||||
35 | some_form_param: str = Form(),
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
38 | some_header_param: int = Header(default=5),
|
||||
39 | ):
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -234,16 +241,17 @@ FAST002_0.py:37:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
39 40 | ):
|
||||
40 41 | # do stuff
|
||||
|
||||
FAST002_0.py:38:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:38:5
|
||||
|
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
38 | some_header_param: int = Header(default=5),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
39 | ):
|
||||
40 | # do stuff
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -263,16 +271,17 @@ FAST002_0.py:38:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
40 41 | # do stuff
|
||||
41 42 | pass
|
||||
|
||||
FAST002_0.py:47:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:47:5
|
||||
|
|
||||
45 | skip: int,
|
||||
46 | limit: int,
|
||||
47 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
48 | ):
|
||||
49 | pass
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -292,16 +301,17 @@ FAST002_0.py:47:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
49 50 | pass
|
||||
50 51 |
|
||||
|
||||
FAST002_0.py:53:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:53:5
|
||||
|
|
||||
51 | @app.get("/users/")
|
||||
52 | def get_users(
|
||||
53 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
54 | skip: int = 0,
|
||||
55 | limit: int = 10,
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -321,14 +331,15 @@ FAST002_0.py:53:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
55 56 | limit: int = 10,
|
||||
56 57 | ):
|
||||
|
||||
FAST002_0.py:61:25: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:61:25
|
||||
|
|
||||
60 | @app.get("/items/{item_id}")
|
||||
61 | async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
62 | pass
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -348,13 +359,14 @@ FAST002_0.py:61:25: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
63 64 |
|
||||
64 65 | # Non fixable errors
|
||||
|
||||
FAST002_0.py:70:5: FAST002 FastAPI dependency without `Annotated`
|
||||
FAST002 FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:70:5
|
||||
|
|
||||
68 | skip: int = 0,
|
||||
69 | limit: int = 10,
|
||||
70 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
71 | ):
|
||||
72 | pass
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/fastapi/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
FAST002_0.py:24:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:24:5
|
||||
|
|
||||
22 | @app.get("/items/")
|
||||
23 | def get_items(
|
||||
24 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
25 | some_security_param: str = Security(get_oauth2_user),
|
||||
26 | ):
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -31,16 +31,17 @@ FAST002_0.py:24:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
26 27 | ):
|
||||
27 28 | pass
|
||||
|
||||
FAST002_0.py:25:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:25:5
|
||||
|
|
||||
23 | def get_items(
|
||||
24 | current_user: User = Depends(get_current_user),
|
||||
25 | some_security_param: str = Security(get_oauth2_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
26 | ):
|
||||
27 | pass
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -60,16 +61,17 @@ FAST002_0.py:25:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
27 28 | pass
|
||||
28 29 |
|
||||
|
||||
FAST002_0.py:32:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:32:5
|
||||
|
|
||||
30 | @app.post("/stuff/")
|
||||
31 | def do_stuff(
|
||||
32 | some_path_param: str = Path(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -89,16 +91,17 @@ FAST002_0.py:32:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
34 35 | some_file_param: UploadFile = File(),
|
||||
35 36 | some_form_param: str = Form(),
|
||||
|
||||
FAST002_0.py:33:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:33:5
|
||||
|
|
||||
31 | def do_stuff(
|
||||
32 | some_path_param: str = Path(),
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
35 | some_form_param: str = Form(),
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -118,16 +121,17 @@ FAST002_0.py:33:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
35 36 | some_form_param: str = Form(),
|
||||
36 37 | some_query_param: str | None = Query(default=None),
|
||||
|
||||
FAST002_0.py:34:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:34:5
|
||||
|
|
||||
32 | some_path_param: str = Path(),
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
35 | some_form_param: str = Form(),
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -147,16 +151,17 @@ FAST002_0.py:34:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
36 37 | some_query_param: str | None = Query(default=None),
|
||||
37 38 | some_body_param: str = Body("foo"),
|
||||
|
||||
FAST002_0.py:35:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:35:5
|
||||
|
|
||||
33 | some_cookie_param: str = Cookie(),
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
35 | some_form_param: str = Form(),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -176,16 +181,17 @@ FAST002_0.py:35:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
37 38 | some_body_param: str = Body("foo"),
|
||||
38 39 | some_header_param: int = Header(default=5),
|
||||
|
||||
FAST002_0.py:36:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:36:5
|
||||
|
|
||||
34 | some_file_param: UploadFile = File(),
|
||||
35 | some_form_param: str = Form(),
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
38 | some_header_param: int = Header(default=5),
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -205,16 +211,17 @@ FAST002_0.py:36:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
38 39 | some_header_param: int = Header(default=5),
|
||||
39 40 | ):
|
||||
|
||||
FAST002_0.py:37:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:37:5
|
||||
|
|
||||
35 | some_form_param: str = Form(),
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
38 | some_header_param: int = Header(default=5),
|
||||
39 | ):
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -234,16 +241,17 @@ FAST002_0.py:37:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
39 40 | ):
|
||||
40 41 | # do stuff
|
||||
|
||||
FAST002_0.py:38:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:38:5
|
||||
|
|
||||
36 | some_query_param: str | None = Query(default=None),
|
||||
37 | some_body_param: str = Body("foo"),
|
||||
38 | some_header_param: int = Header(default=5),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
39 | ):
|
||||
40 | # do stuff
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -263,16 +271,17 @@ FAST002_0.py:38:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
40 41 | # do stuff
|
||||
41 42 | pass
|
||||
|
||||
FAST002_0.py:47:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:47:5
|
||||
|
|
||||
45 | skip: int,
|
||||
46 | limit: int,
|
||||
47 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
48 | ):
|
||||
49 | pass
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -292,16 +301,17 @@ FAST002_0.py:47:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
49 50 | pass
|
||||
50 51 |
|
||||
|
||||
FAST002_0.py:53:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:53:5
|
||||
|
|
||||
51 | @app.get("/users/")
|
||||
52 | def get_users(
|
||||
53 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
54 | skip: int = 0,
|
||||
55 | limit: int = 10,
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -321,14 +331,15 @@ FAST002_0.py:53:5: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
55 56 | limit: int = 10,
|
||||
56 57 | ):
|
||||
|
||||
FAST002_0.py:61:25: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:61:25
|
||||
|
|
||||
60 | @app.get("/items/{item_id}")
|
||||
61 | async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
62 | pass
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 | Security,
|
||||
@@ -348,13 +359,14 @@ FAST002_0.py:61:25: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
63 64 |
|
||||
64 65 | # Non fixable errors
|
||||
|
||||
FAST002_0.py:70:5: FAST002 FastAPI dependency without `Annotated`
|
||||
FAST002 FastAPI dependency without `Annotated`
|
||||
--> FAST002_0.py:70:5
|
||||
|
|
||||
68 | skip: int = 0,
|
||||
69 | limit: int = 10,
|
||||
70 | current_user: User = Depends(get_current_user),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
71 | ):
|
||||
72 | pass
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/fastapi/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
FAST002_1.py:10:13: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_1.py:10:13
|
||||
|
|
||||
9 | @app.get("/test")
|
||||
10 | def handler(echo: str = Query("")):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
11 | return echo
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 | values. See #15043 for more details."""
|
||||
@@ -27,14 +27,15 @@ FAST002_1.py:10:13: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
12 13 |
|
||||
13 14 |
|
||||
|
||||
FAST002_1.py:15:14: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_1.py:15:14
|
||||
|
|
||||
14 | @app.get("/test")
|
||||
15 | def handler2(echo: str = Query(default="")):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
16 | return echo
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 | values. See #15043 for more details."""
|
||||
@@ -54,14 +55,15 @@ FAST002_1.py:15:14: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
17 18 |
|
||||
18 19 |
|
||||
|
||||
FAST002_1.py:20:14: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_1.py:20:14
|
||||
|
|
||||
19 | @app.get("/test")
|
||||
20 | def handler3(echo: str = Query("123", min_length=3, max_length=50)):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
21 | return echo
|
||||
|
|
||||
= help: Replace with `typing.Annotated`
|
||||
help: Replace with `typing.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 | values. See #15043 for more details."""
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/fastapi/mod.rs
|
||||
snapshot_kind: text
|
||||
---
|
||||
FAST002_1.py:10:13: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_1.py:10:13
|
||||
|
|
||||
9 | @app.get("/test")
|
||||
10 | def handler(echo: str = Query("")):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
11 | return echo
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 | values. See #15043 for more details."""
|
||||
@@ -27,14 +27,15 @@ FAST002_1.py:10:13: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
12 13 |
|
||||
13 14 |
|
||||
|
||||
FAST002_1.py:15:14: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_1.py:15:14
|
||||
|
|
||||
14 | @app.get("/test")
|
||||
15 | def handler2(echo: str = Query(default="")):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
16 | return echo
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 | values. See #15043 for more details."""
|
||||
@@ -54,14 +55,15 @@ FAST002_1.py:15:14: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
17 18 |
|
||||
18 19 |
|
||||
|
||||
FAST002_1.py:20:14: FAST002 [*] FastAPI dependency without `Annotated`
|
||||
FAST002 [*] FastAPI dependency without `Annotated`
|
||||
--> FAST002_1.py:20:14
|
||||
|
|
||||
19 | @app.get("/test")
|
||||
20 | def handler3(echo: str = Query("123", min_length=3, max_length=50)):
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST002
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
21 | return echo
|
||||
|
|
||||
= help: Replace with `typing_extensions.Annotated`
|
||||
help: Replace with `typing_extensions.Annotated`
|
||||
|
||||
ℹ Unsafe fix
|
||||
2 2 | values. See #15043 for more details."""
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/fastapi/mod.rs
|
||||
---
|
||||
FAST001.py:17:22: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:17:22
|
||||
|
|
||||
17 | @app.post("/items/", response_model=Item)
|
||||
| ^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
18 | async def create_item(item: Item) -> Item:
|
||||
19 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
14 14 | # Errors
|
||||
@@ -20,14 +21,15 @@ FAST001.py:17:22: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
19 19 | return item
|
||||
20 20 |
|
||||
|
||||
FAST001.py:22:22: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:22:22
|
||||
|
|
||||
22 | @app.post("/items/", response_model=list[Item])
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
23 | async def create_item(item: Item) -> list[Item]:
|
||||
24 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
19 19 | return item
|
||||
@@ -39,14 +41,15 @@ FAST001.py:22:22: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
24 24 | return item
|
||||
25 25 |
|
||||
|
||||
FAST001.py:27:22: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:27:22
|
||||
|
|
||||
27 | @app.post("/items/", response_model=List[Item])
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
28 | async def create_item(item: Item) -> List[Item]:
|
||||
29 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
24 24 | return item
|
||||
@@ -58,14 +61,15 @@ FAST001.py:27:22: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
29 29 | return item
|
||||
30 30 |
|
||||
|
||||
FAST001.py:32:22: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:32:22
|
||||
|
|
||||
32 | @app.post("/items/", response_model=Dict[str, Item])
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
33 | async def create_item(item: Item) -> Dict[str, Item]:
|
||||
34 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
29 29 | return item
|
||||
@@ -77,14 +81,15 @@ FAST001.py:32:22: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
34 34 | return item
|
||||
35 35 |
|
||||
|
||||
FAST001.py:37:22: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:37:22
|
||||
|
|
||||
37 | @app.post("/items/", response_model=str)
|
||||
| ^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
38 | async def create_item(item: Item) -> str:
|
||||
39 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
34 34 | return item
|
||||
@@ -96,14 +101,15 @@ FAST001.py:37:22: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
39 39 | return item
|
||||
40 40 |
|
||||
|
||||
FAST001.py:42:21: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:42:21
|
||||
|
|
||||
42 | @app.get("/items/", response_model=Item)
|
||||
| ^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
43 | async def create_item(item: Item) -> Item:
|
||||
44 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
39 39 | return item
|
||||
@@ -115,14 +121,15 @@ FAST001.py:42:21: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
44 44 | return item
|
||||
45 45 |
|
||||
|
||||
FAST001.py:47:21: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:47:21
|
||||
|
|
||||
47 | @app.get("/items/", response_model=Item)
|
||||
| ^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
48 | @app.post("/items/", response_model=Item)
|
||||
49 | async def create_item(item: Item) -> Item:
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
44 44 | return item
|
||||
@@ -134,15 +141,16 @@ FAST001.py:47:21: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
49 49 | async def create_item(item: Item) -> Item:
|
||||
50 50 | return item
|
||||
|
||||
FAST001.py:48:22: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:48:22
|
||||
|
|
||||
47 | @app.get("/items/", response_model=Item)
|
||||
48 | @app.post("/items/", response_model=Item)
|
||||
| ^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
49 | async def create_item(item: Item) -> Item:
|
||||
50 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
45 45 |
|
||||
@@ -154,14 +162,15 @@ FAST001.py:48:22: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
50 50 | return item
|
||||
51 51 |
|
||||
|
||||
FAST001.py:53:24: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:53:24
|
||||
|
|
||||
53 | @router.get("/items/", response_model=Item)
|
||||
| ^^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
54 | async def create_item(item: Item) -> Item:
|
||||
55 | return item
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
50 50 | return item
|
||||
@@ -173,16 +182,17 @@ FAST001.py:53:24: FAST001 [*] FastAPI route with redundant `response_model` argu
|
||||
55 55 | return item
|
||||
56 56 |
|
||||
|
||||
FAST001.py:118:23: FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
FAST001 [*] FastAPI route with redundant `response_model` argument
|
||||
--> FAST001.py:118:23
|
||||
|
|
||||
116 | def setup_app(app_arg: FastAPI, non_app: str) -> None:
|
||||
117 | # Error
|
||||
118 | @app_arg.get("/", response_model=str)
|
||||
| ^^^^^^^^^^^^^^^^^^ FAST001
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
119 | async def get_root() -> str:
|
||||
120 | return "Hello World!"
|
||||
|
|
||||
= help: Remove argument
|
||||
help: Remove argument
|
||||
|
||||
ℹ Unsafe fix
|
||||
115 115 |
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/fastapi/mod.rs
|
||||
---
|
||||
FAST003.py:9:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:9:19
|
||||
|
|
||||
8 | # Errors
|
||||
9 | @app.get("/things/{thing_id}")
|
||||
| ^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^
|
||||
10 | async def read_thing(query: str):
|
||||
11 | return {"query": query}
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
7 7 |
|
||||
@@ -21,14 +22,15 @@ FAST003.py:9:19: FAST003 [*] Parameter `thing_id` appears in route path, but not
|
||||
12 12 |
|
||||
13 13 |
|
||||
|
||||
FAST003.py:14:23: FAST003 [*] Parameter `isbn` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `isbn` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:14:23
|
||||
|
|
||||
14 | @app.get("/books/isbn-{isbn}")
|
||||
| ^^^^^^ FAST003
|
||||
| ^^^^^^
|
||||
15 | async def read_thing():
|
||||
16 | ...
|
||||
|
|
||||
= help: Add `isbn` to function signature
|
||||
help: Add `isbn` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
12 12 |
|
||||
@@ -40,14 +42,15 @@ FAST003.py:14:23: FAST003 [*] Parameter `isbn` appears in route path, but not in
|
||||
17 17 |
|
||||
18 18 |
|
||||
|
||||
FAST003.py:19:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:19:19
|
||||
|
|
||||
19 | @app.get("/things/{thing_id:path}")
|
||||
| ^^^^^^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^^^^^^
|
||||
20 | async def read_thing(query: str):
|
||||
21 | return {"query": query}
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
17 17 |
|
||||
@@ -59,14 +62,15 @@ FAST003.py:19:19: FAST003 [*] Parameter `thing_id` appears in route path, but no
|
||||
22 22 |
|
||||
23 23 |
|
||||
|
||||
FAST003.py:24:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:24:19
|
||||
|
|
||||
24 | @app.get("/things/{thing_id : path}")
|
||||
| ^^^^^^^^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
25 | async def read_thing(query: str):
|
||||
26 | return {"query": query}
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
22 22 |
|
||||
@@ -78,14 +82,15 @@ FAST003.py:24:19: FAST003 [*] Parameter `thing_id` appears in route path, but no
|
||||
27 27 |
|
||||
28 28 |
|
||||
|
||||
FAST003.py:29:27: FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:29:27
|
||||
|
|
||||
29 | @app.get("/books/{author}/{title}")
|
||||
| ^^^^^^^ FAST003
|
||||
| ^^^^^^^
|
||||
30 | async def read_thing(author: str):
|
||||
31 | return {"author": author}
|
||||
|
|
||||
= help: Add `title` to function signature
|
||||
help: Add `title` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
27 27 |
|
||||
@@ -97,14 +102,15 @@ FAST003.py:29:27: FAST003 [*] Parameter `title` appears in route path, but not i
|
||||
32 32 |
|
||||
33 33 |
|
||||
|
||||
FAST003.py:34:18: FAST003 [*] Parameter `author_name` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `author_name` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:34:18
|
||||
|
|
||||
34 | @app.get("/books/{author_name}/{title}")
|
||||
| ^^^^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^^^^
|
||||
35 | async def read_thing():
|
||||
36 | ...
|
||||
|
|
||||
= help: Add `author_name` to function signature
|
||||
help: Add `author_name` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
32 32 |
|
||||
@@ -116,14 +122,15 @@ FAST003.py:34:18: FAST003 [*] Parameter `author_name` appears in route path, but
|
||||
37 37 |
|
||||
38 38 |
|
||||
|
||||
FAST003.py:34:32: FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:34:32
|
||||
|
|
||||
34 | @app.get("/books/{author_name}/{title}")
|
||||
| ^^^^^^^ FAST003
|
||||
| ^^^^^^^
|
||||
35 | async def read_thing():
|
||||
36 | ...
|
||||
|
|
||||
= help: Add `title` to function signature
|
||||
help: Add `title` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
32 32 |
|
||||
@@ -135,30 +142,33 @@ FAST003.py:34:32: FAST003 [*] Parameter `title` appears in route path, but not i
|
||||
37 37 |
|
||||
38 38 |
|
||||
|
||||
FAST003.py:39:18: FAST003 Parameter `author` appears in route path, but only as a positional-only argument in `read_thing` signature
|
||||
FAST003 Parameter `author` appears in route path, but only as a positional-only argument in `read_thing` signature
|
||||
--> FAST003.py:39:18
|
||||
|
|
||||
39 | @app.get("/books/{author}/{title}")
|
||||
| ^^^^^^^^ FAST003
|
||||
| ^^^^^^^^
|
||||
40 | async def read_thing(author: str, title: str, /):
|
||||
41 | return {"author": author, "title": title}
|
||||
|
|
||||
|
||||
FAST003.py:39:27: FAST003 Parameter `title` appears in route path, but only as a positional-only argument in `read_thing` signature
|
||||
FAST003 Parameter `title` appears in route path, but only as a positional-only argument in `read_thing` signature
|
||||
--> FAST003.py:39:27
|
||||
|
|
||||
39 | @app.get("/books/{author}/{title}")
|
||||
| ^^^^^^^ FAST003
|
||||
| ^^^^^^^
|
||||
40 | async def read_thing(author: str, title: str, /):
|
||||
41 | return {"author": author, "title": title}
|
||||
|
|
||||
|
||||
FAST003.py:44:27: FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:44:27
|
||||
|
|
||||
44 | @app.get("/books/{author}/{title}/{page}")
|
||||
| ^^^^^^^ FAST003
|
||||
| ^^^^^^^
|
||||
45 | async def read_thing(
|
||||
46 | author: str,
|
||||
|
|
||||
= help: Add `title` to function signature
|
||||
help: Add `title` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
44 44 | @app.get("/books/{author}/{title}/{page}")
|
||||
@@ -170,14 +180,15 @@ FAST003.py:44:27: FAST003 [*] Parameter `title` appears in route path, but not i
|
||||
49 49 |
|
||||
50 50 |
|
||||
|
||||
FAST003.py:44:35: FAST003 [*] Parameter `page` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `page` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:44:35
|
||||
|
|
||||
44 | @app.get("/books/{author}/{title}/{page}")
|
||||
| ^^^^^^ FAST003
|
||||
| ^^^^^^
|
||||
45 | async def read_thing(
|
||||
46 | author: str,
|
||||
|
|
||||
= help: Add `page` to function signature
|
||||
help: Add `page` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
44 44 | @app.get("/books/{author}/{title}/{page}")
|
||||
@@ -189,14 +200,15 @@ FAST003.py:44:35: FAST003 [*] Parameter `page` appears in route path, but not in
|
||||
49 49 |
|
||||
50 50 |
|
||||
|
||||
FAST003.py:51:18: FAST003 [*] Parameter `author` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `author` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:51:18
|
||||
|
|
||||
51 | @app.get("/books/{author}/{title}")
|
||||
| ^^^^^^^^ FAST003
|
||||
| ^^^^^^^^
|
||||
52 | async def read_thing():
|
||||
53 | ...
|
||||
|
|
||||
= help: Add `author` to function signature
|
||||
help: Add `author` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
49 49 |
|
||||
@@ -208,14 +220,15 @@ FAST003.py:51:18: FAST003 [*] Parameter `author` appears in route path, but not
|
||||
54 54 |
|
||||
55 55 |
|
||||
|
||||
FAST003.py:51:27: FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:51:27
|
||||
|
|
||||
51 | @app.get("/books/{author}/{title}")
|
||||
| ^^^^^^^ FAST003
|
||||
| ^^^^^^^
|
||||
52 | async def read_thing():
|
||||
53 | ...
|
||||
|
|
||||
= help: Add `title` to function signature
|
||||
help: Add `title` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
49 49 |
|
||||
@@ -227,14 +240,15 @@ FAST003.py:51:27: FAST003 [*] Parameter `title` appears in route path, but not i
|
||||
54 54 |
|
||||
55 55 |
|
||||
|
||||
FAST003.py:56:27: FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:56:27
|
||||
|
|
||||
56 | @app.get("/books/{author}/{title}")
|
||||
| ^^^^^^^ FAST003
|
||||
| ^^^^^^^
|
||||
57 | async def read_thing(*, author: str):
|
||||
58 | ...
|
||||
|
|
||||
= help: Add `title` to function signature
|
||||
help: Add `title` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
54 54 |
|
||||
@@ -246,14 +260,15 @@ FAST003.py:56:27: FAST003 [*] Parameter `title` appears in route path, but not i
|
||||
59 59 |
|
||||
60 60 |
|
||||
|
||||
FAST003.py:61:27: FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:61:27
|
||||
|
|
||||
61 | @app.get("/books/{author}/{title}")
|
||||
| ^^^^^^^ FAST003
|
||||
| ^^^^^^^
|
||||
62 | async def read_thing(hello, /, *, author: str):
|
||||
63 | ...
|
||||
|
|
||||
= help: Add `title` to function signature
|
||||
help: Add `title` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
59 59 |
|
||||
@@ -265,14 +280,15 @@ FAST003.py:61:27: FAST003 [*] Parameter `title` appears in route path, but not i
|
||||
64 64 |
|
||||
65 65 |
|
||||
|
||||
FAST003.py:66:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:66:19
|
||||
|
|
||||
66 | @app.get("/things/{thing_id}")
|
||||
| ^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^
|
||||
67 | async def read_thing(
|
||||
68 | query: str,
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
65 65 |
|
||||
@@ -284,14 +300,15 @@ FAST003.py:66:19: FAST003 [*] Parameter `thing_id` appears in route path, but no
|
||||
70 70 | return {"query": query}
|
||||
71 71 |
|
||||
|
||||
FAST003.py:73:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:73:19
|
||||
|
|
||||
73 | @app.get("/things/{thing_id}")
|
||||
| ^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^
|
||||
74 | async def read_thing(
|
||||
75 | query: str = "default",
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
72 72 |
|
||||
@@ -303,14 +320,15 @@ FAST003.py:73:19: FAST003 [*] Parameter `thing_id` appears in route path, but no
|
||||
77 77 | return {"query": query}
|
||||
78 78 |
|
||||
|
||||
FAST003.py:80:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:80:19
|
||||
|
|
||||
80 | @app.get("/things/{thing_id}")
|
||||
| ^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^
|
||||
81 | async def read_thing(
|
||||
82 | *, query: str = "default",
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
79 79 |
|
||||
@@ -322,14 +340,15 @@ FAST003.py:80:19: FAST003 [*] Parameter `thing_id` appears in route path, but no
|
||||
84 84 | return {"query": query}
|
||||
85 85 |
|
||||
|
||||
FAST003.py:87:18: FAST003 [*] Parameter `name` appears in route path, but not in `read_thing` signature
|
||||
FAST003 [*] Parameter `name` appears in route path, but not in `read_thing` signature
|
||||
--> FAST003.py:87:18
|
||||
|
|
||||
87 | @app.get("/books/{name}/{title}")
|
||||
| ^^^^^^ FAST003
|
||||
| ^^^^^^
|
||||
88 | async def read_thing(*, author: Annotated[str, Path(alias="author_name")], title: str):
|
||||
89 | return {"author": author, "title": title}
|
||||
|
|
||||
= help: Add `name` to function signature
|
||||
help: Add `name` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
85 85 |
|
||||
@@ -341,15 +360,16 @@ FAST003.py:87:18: FAST003 [*] Parameter `name` appears in route path, but not in
|
||||
90 90 |
|
||||
91 91 |
|
||||
|
||||
FAST003.py:158:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `single` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `single` signature
|
||||
--> FAST003.py:158:19
|
||||
|
|
||||
157 | ### Errors
|
||||
158 | @app.get("/things/{thing_id}")
|
||||
| ^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^
|
||||
159 | async def single(other: Annotated[str, Depends(something_else)]): ...
|
||||
160 | @app.get("/things/{thing_id}")
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
156 156 |
|
||||
@@ -361,15 +381,16 @@ FAST003.py:158:19: FAST003 [*] Parameter `thing_id` appears in route path, but n
|
||||
161 161 | async def default(other: str = Depends(something_else)): ...
|
||||
162 162 |
|
||||
|
||||
FAST003.py:160:19: FAST003 [*] Parameter `thing_id` appears in route path, but not in `default` signature
|
||||
FAST003 [*] Parameter `thing_id` appears in route path, but not in `default` signature
|
||||
--> FAST003.py:160:19
|
||||
|
|
||||
158 | @app.get("/things/{thing_id}")
|
||||
159 | async def single(other: Annotated[str, Depends(something_else)]): ...
|
||||
160 | @app.get("/things/{thing_id}")
|
||||
| ^^^^^^^^^^ FAST003
|
||||
| ^^^^^^^^^^
|
||||
161 | async def default(other: str = Depends(something_else)): ...
|
||||
|
|
||||
= help: Add `thing_id` to function signature
|
||||
help: Add `thing_id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
158 158 | @app.get("/things/{thing_id}")
|
||||
@@ -381,15 +402,16 @@ FAST003.py:160:19: FAST003 [*] Parameter `thing_id` appears in route path, but n
|
||||
163 163 |
|
||||
164 164 | ### No errors
|
||||
|
||||
FAST003.py:197:12: FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_full` signature
|
||||
FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_full` signature
|
||||
--> FAST003.py:197:12
|
||||
|
|
||||
196 | # Errors
|
||||
197 | @app.get("/{id}")
|
||||
| ^^^^ FAST003
|
||||
| ^^^^
|
||||
198 | async def get_id_pydantic_full(
|
||||
199 | params: Annotated[PydanticParams, Depends(PydanticParams)],
|
||||
|
|
||||
= help: Add `id` to function signature
|
||||
help: Add `id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
196 196 | # Errors
|
||||
@@ -401,16 +423,17 @@ FAST003.py:197:12: FAST003 [*] Parameter `id` appears in route path, but not in
|
||||
201 201 | @app.get("/{id}")
|
||||
202 202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
|
||||
|
||||
FAST003.py:201:12: FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_short` signature
|
||||
FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_short` signature
|
||||
--> FAST003.py:201:12
|
||||
|
|
||||
199 | params: Annotated[PydanticParams, Depends(PydanticParams)],
|
||||
200 | ): ...
|
||||
201 | @app.get("/{id}")
|
||||
| ^^^^ FAST003
|
||||
| ^^^^
|
||||
202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
|
||||
203 | @app.get("/{id}")
|
||||
|
|
||||
= help: Add `id` to function signature
|
||||
help: Add `id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
199 199 | params: Annotated[PydanticParams, Depends(PydanticParams)],
|
||||
@@ -422,15 +445,16 @@ FAST003.py:201:12: FAST003 [*] Parameter `id` appears in route path, but not in
|
||||
204 204 | async def get_id_init_not_annotated(params = Depends(InitParams)): ...
|
||||
205 205 |
|
||||
|
||||
FAST003.py:203:12: FAST003 [*] Parameter `id` appears in route path, but not in `get_id_init_not_annotated` signature
|
||||
FAST003 [*] Parameter `id` appears in route path, but not in `get_id_init_not_annotated` signature
|
||||
--> FAST003.py:203:12
|
||||
|
|
||||
201 | @app.get("/{id}")
|
||||
202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
|
||||
203 | @app.get("/{id}")
|
||||
| ^^^^ FAST003
|
||||
| ^^^^
|
||||
204 | async def get_id_init_not_annotated(params = Depends(InitParams)): ...
|
||||
|
|
||||
= help: Add `id` to function signature
|
||||
help: Add `id` to function signature
|
||||
|
||||
ℹ Unsafe fix
|
||||
201 201 | @app.get("/{id}")
|
||||
|
||||
@@ -1,30 +1,33 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
|
||||
---
|
||||
YTT101.py:6:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
|
||||
YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
|
||||
--> YTT101.py:6:7
|
||||
|
|
||||
4 | print(sys.version)
|
||||
5 |
|
||||
6 | print(sys.version[:3])
|
||||
| ^^^^^^^^^^^ YTT101
|
||||
| ^^^^^^^^^^^
|
||||
7 | print(version[:3])
|
||||
8 | print(v[:3])
|
||||
|
|
||||
|
||||
YTT101.py:7:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
|
||||
YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
|
||||
--> YTT101.py:7:7
|
||||
|
|
||||
6 | print(sys.version[:3])
|
||||
7 | print(version[:3])
|
||||
| ^^^^^^^ YTT101
|
||||
| ^^^^^^^
|
||||
8 | print(v[:3])
|
||||
|
|
||||
|
||||
YTT101.py:8:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
|
||||
YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
|
||||
--> YTT101.py:8:7
|
||||
|
|
||||
6 | print(sys.version[:3])
|
||||
7 | print(version[:3])
|
||||
8 | print(v[:3])
|
||||
| ^ YTT101
|
||||
| ^
|
||||
9 |
|
||||
10 | # the tool is timid and only flags certain numeric slices
|
||||
|
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
|
||||
---
|
||||
YTT102.py:4:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info`
|
||||
YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info`
|
||||
--> YTT102.py:4:12
|
||||
|
|
||||
2 | from sys import version
|
||||
3 |
|
||||
4 | py_minor = sys.version[2]
|
||||
| ^^^^^^^^^^^ YTT102
|
||||
| ^^^^^^^^^^^
|
||||
5 | py_minor = version[2]
|
||||
|
|
||||
|
||||
YTT102.py:5:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info`
|
||||
YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info`
|
||||
--> YTT102.py:5:12
|
||||
|
|
||||
4 | py_minor = sys.version[2]
|
||||
5 | py_minor = version[2]
|
||||
| ^^^^^^^ YTT102
|
||||
| ^^^^^^^
|
||||
|
|
||||
|
||||
@@ -1,48 +1,53 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
|
||||
---
|
||||
YTT103.py:4:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
--> YTT103.py:4:1
|
||||
|
|
||||
2 | from sys import version
|
||||
3 |
|
||||
4 | version < "3.5"
|
||||
| ^^^^^^^ YTT103
|
||||
| ^^^^^^^
|
||||
5 | sys.version < "3.5"
|
||||
6 | sys.version <= "3.5"
|
||||
|
|
||||
|
||||
YTT103.py:5:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
--> YTT103.py:5:1
|
||||
|
|
||||
4 | version < "3.5"
|
||||
5 | sys.version < "3.5"
|
||||
| ^^^^^^^^^^^ YTT103
|
||||
| ^^^^^^^^^^^
|
||||
6 | sys.version <= "3.5"
|
||||
7 | sys.version > "3.5"
|
||||
|
|
||||
|
||||
YTT103.py:6:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
--> YTT103.py:6:1
|
||||
|
|
||||
4 | version < "3.5"
|
||||
5 | sys.version < "3.5"
|
||||
6 | sys.version <= "3.5"
|
||||
| ^^^^^^^^^^^ YTT103
|
||||
| ^^^^^^^^^^^
|
||||
7 | sys.version > "3.5"
|
||||
8 | sys.version >= "3.5"
|
||||
|
|
||||
|
||||
YTT103.py:7:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
--> YTT103.py:7:1
|
||||
|
|
||||
5 | sys.version < "3.5"
|
||||
6 | sys.version <= "3.5"
|
||||
7 | sys.version > "3.5"
|
||||
| ^^^^^^^^^^^ YTT103
|
||||
| ^^^^^^^^^^^
|
||||
8 | sys.version >= "3.5"
|
||||
|
|
||||
|
||||
YTT103.py:8:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
|
||||
--> YTT103.py:8:1
|
||||
|
|
||||
6 | sys.version <= "3.5"
|
||||
7 | sys.version > "3.5"
|
||||
8 | sys.version >= "3.5"
|
||||
| ^^^^^^^^^^^ YTT103
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
|
||||
@@ -1,38 +1,42 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
|
||||
---
|
||||
YTT201.py:7:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
|
||||
YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
|
||||
--> YTT201.py:7:7
|
||||
|
|
||||
5 | PY3 = sys.version_info[0] >= 3
|
||||
6 |
|
||||
7 | PY3 = sys.version_info[0] == 3
|
||||
| ^^^^^^^^^^^^^^^^^^^ YTT201
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
8 | PY3 = version_info[0] == 3
|
||||
9 | PY2 = sys.version_info[0] != 3
|
||||
|
|
||||
|
||||
YTT201.py:8:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
|
||||
YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
|
||||
--> YTT201.py:8:7
|
||||
|
|
||||
7 | PY3 = sys.version_info[0] == 3
|
||||
8 | PY3 = version_info[0] == 3
|
||||
| ^^^^^^^^^^^^^^^ YTT201
|
||||
| ^^^^^^^^^^^^^^^
|
||||
9 | PY2 = sys.version_info[0] != 3
|
||||
10 | PY2 = version_info[0] != 3
|
||||
|
|
||||
|
||||
YTT201.py:9:7: YTT201 `sys.version_info[0] != 3` referenced (python4), use `<`
|
||||
YTT201 `sys.version_info[0] != 3` referenced (python4), use `<`
|
||||
--> YTT201.py:9:7
|
||||
|
|
||||
7 | PY3 = sys.version_info[0] == 3
|
||||
8 | PY3 = version_info[0] == 3
|
||||
9 | PY2 = sys.version_info[0] != 3
|
||||
| ^^^^^^^^^^^^^^^^^^^ YTT201
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
10 | PY2 = version_info[0] != 3
|
||||
|
|
||||
|
||||
YTT201.py:10:7: YTT201 `sys.version_info[0] != 3` referenced (python4), use `<`
|
||||
YTT201 `sys.version_info[0] != 3` referenced (python4), use `<`
|
||||
--> YTT201.py:10:7
|
||||
|
|
||||
8 | PY3 = version_info[0] == 3
|
||||
9 | PY2 = sys.version_info[0] != 3
|
||||
10 | PY2 = version_info[0] != 3
|
||||
| ^^^^^^^^^^^^^^^ YTT201
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
---
|
||||
source: crates/ruff_linter/src/rules/flake8_2020/mod.rs
|
||||
---
|
||||
YTT202.py:4:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2`
|
||||
YTT202 `six.PY3` referenced (python4), use `not six.PY2`
|
||||
--> YTT202.py:4:4
|
||||
|
|
||||
2 | from six import PY3
|
||||
3 |
|
||||
4 | if six.PY3:
|
||||
| ^^^^^^^ YTT202
|
||||
| ^^^^^^^
|
||||
5 | print("3")
|
||||
6 | if PY3:
|
||||
|
|
||||
|
||||
YTT202.py:6:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2`
|
||||
YTT202 `six.PY3` referenced (python4), use `not six.PY2`
|
||||
--> YTT202.py:6:4
|
||||
|
|
||||
4 | if six.PY3:
|
||||
5 | print("3")
|
||||
6 | if PY3:
|
||||
| ^^^ YTT202
|
||||
| ^^^
|
||||
7 | print("3")
|
||||
|
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user