Compare commits

..

2 Commits

Author SHA1 Message Date
Alex Waygood
446a1ba2e1 example implementation of is_disjoint_from 2025-08-26 09:57:16 +01:00
Alex Waygood
1c7f3cd2b8 Prototype code structure for NewType implementation 2025-08-25 23:13:36 +01:00
1201 changed files with 83544 additions and 79611 deletions

View File

@@ -250,7 +250,7 @@ jobs:
- name: "Install Rust toolchain"
run: rustup show
- name: "Install mold"
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
- name: "Install cargo nextest"
uses: taiki-e/install-action@6064345e6658255e90e9500fdf9a06ab77e6909c # v2.57.6
with:
@@ -308,7 +308,7 @@ jobs:
- name: "Install Rust toolchain"
run: rustup show
- name: "Install mold"
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
- name: "Install cargo nextest"
uses: taiki-e/install-action@6064345e6658255e90e9500fdf9a06ab77e6909c # v2.57.6
with:
@@ -393,7 +393,7 @@ jobs:
- name: "Install Rust toolchain"
run: rustup show
- name: "Install mold"
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
- name: "Build"
run: cargo build --release --locked
@@ -418,7 +418,7 @@ jobs:
MSRV: ${{ steps.msrv.outputs.value }}
run: rustup default "${MSRV}"
- name: "Install mold"
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
uses: rui314/setup-mold@7344740a9418dcdcb481c7df83d9fbd1d5072d7d # v1
- name: "Build tests"
shell: bash
env:
@@ -441,7 +441,7 @@ jobs:
- name: "Install Rust toolchain"
run: rustup show
- name: "Install cargo-binstall"
uses: cargo-bins/cargo-binstall@2bb61346d075e720d4c3da92f23b6d612d5a7543 # v1.15.3
uses: cargo-bins/cargo-binstall@0dca8cf8dfb40cb77a29cece06933ce674674523 # v1.15.1
with:
tool: cargo-fuzz@0.11.2
- name: "Install cargo-fuzz"
@@ -694,7 +694,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: cargo-bins/cargo-binstall@2bb61346d075e720d4c3da92f23b6d612d5a7543 # v1.15.3
- uses: cargo-bins/cargo-binstall@0dca8cf8dfb40cb77a29cece06933ce674674523 # v1.15.1
- run: cargo binstall --no-confirm cargo-shear
- run: cargo shear
@@ -923,7 +923,7 @@ jobs:
run: cargo codspeed build --features "codspeed,instrumented" --no-default-features -p ruff_benchmark
- name: "Run benchmarks"
uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1
uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
@@ -956,7 +956,7 @@ jobs:
run: cargo codspeed build --features "codspeed,walltime" --no-default-features -p ruff_benchmark
- name: "Run benchmarks"
uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1
uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}

View File

@@ -38,7 +38,7 @@ jobs:
- name: "Install Rust toolchain"
run: rustup show
- name: "Install mold"
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # 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,

View File

@@ -64,12 +64,11 @@ jobs:
cd ..
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@1f560d07d672effae250e3d271da53d96c5260ff"
uv tool install "git+https://github.com/astral-sh/ecosystem-analyzer@27dd66d9e397d986ef9c631119ee09556eab8af9"
ecosystem-analyzer \
--repository ruff \
diff \
--profile=release \
--projects-old ruff/projects_old.txt \
--projects-new ruff/projects_new.txt \
--old old_commit \

View File

@@ -1,32 +1,5 @@
# Changelog
## 0.12.11
### Preview features
- \[`airflow`\] Extend `AIR311` and `AIR312` rules ([#20082](https://github.com/astral-sh/ruff/pull/20082))
- \[`airflow`\] Replace wrong path `airflow.io.storage` with `airflow.io.store` (`AIR311`) ([#20081](https://github.com/astral-sh/ruff/pull/20081))
- \[`flake8-async`\] Implement `blocking-http-call-httpx-in-async-function` (`ASYNC212`) ([#20091](https://github.com/astral-sh/ruff/pull/20091))
- \[`flake8-logging-format`\] Add auto-fix for f-string logging calls (`G004`) ([#19303](https://github.com/astral-sh/ruff/pull/19303))
- \[`flake8-use-pathlib`\] Add autofix for `PTH211` ([#20009](https://github.com/astral-sh/ruff/pull/20009))
- \[`flake8-use-pathlib`\] Make `PTH100` fix unsafe because it can change behavior ([#20100](https://github.com/astral-sh/ruff/pull/20100))
### Bug fixes
- \[`pyflakes`, `pylint`\] Fix false positives caused by `__class__` cell handling (`F841`, `PLE0117`) ([#20048](https://github.com/astral-sh/ruff/pull/20048))
- \[`pyflakes`\] Fix `allowed-unused-imports` matching for top-level modules (`F401`) ([#20115](https://github.com/astral-sh/ruff/pull/20115))
- \[`ruff`\] Fix false positive for t-strings in `default-factory-kwarg` (`RUF026`) ([#20032](https://github.com/astral-sh/ruff/pull/20032))
- \[`ruff`\] Preserve relative whitespace in multi-line expressions (`RUF033`) ([#19647](https://github.com/astral-sh/ruff/pull/19647))
### Rule changes
- \[`ruff`\] Handle empty t-strings in `unnecessary-empty-iterable-within-deque-call` (`RUF037`) ([#20045](https://github.com/astral-sh/ruff/pull/20045))
### Documentation
- Fix incorrect `D413` links in docstrings convention FAQ ([#20089](https://github.com/astral-sh/ruff/pull/20089))
- \[`flake8-use-pathlib`\] Update links to the table showing the correspondence between `os` and `pathlib` ([#20103](https://github.com/astral-sh/ruff/pull/20103))
## 0.12.10
### Preview features

122
Cargo.lock generated
View File

@@ -295,7 +295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4"
dependencies = [
"memchr",
"regex-automata",
"regex-automata 0.4.10",
"serde",
]
@@ -322,9 +322,9 @@ dependencies = [
[[package]]
name = "camino"
version = "1.1.12"
version = "1.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd0b03af37dad7a14518b7691d81acb0f8222604ad3d1b02f6b4bed5188c0cd5"
checksum = "5d07aa9a93b00c76f71bc35d598bed923f6d4f3a9ca5c24b7737ae1a292841c0"
dependencies = [
"serde",
]
@@ -408,9 +408,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.46"
version = "4.5.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57"
checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318"
dependencies = [
"clap_builder",
"clap_derive",
@@ -418,9 +418,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.46"
version = "4.5.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41"
checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8"
dependencies = [
"anstream",
"anstyle",
@@ -955,7 +955,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.60.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -1035,7 +1035,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
dependencies = [
"libc",
"windows-sys 0.60.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -1231,8 +1231,8 @@ dependencies = [
"aho-corasick",
"bstr",
"log",
"regex-automata",
"regex-syntax",
"regex-automata 0.4.10",
"regex-syntax 0.8.5",
]
[[package]]
@@ -1459,7 +1459,7 @@ dependencies = [
"globset",
"log",
"memchr",
"regex-automata",
"regex-automata 0.4.10",
"same-file",
"walkdir",
"winapi-util",
@@ -1795,9 +1795,9 @@ dependencies = [
[[package]]
name = "libmimalloc-sys"
version = "0.1.44"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870"
checksum = "bf88cd67e9de251c1781dbe2f641a1a3ad66eaae831b8a2c38fbdc5ddae16d4d"
dependencies = [
"cc",
"libc",
@@ -1913,11 +1913,11 @@ dependencies = [
[[package]]
name = "matchers"
version = "0.2.0"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
dependencies = [
"regex-automata",
"regex-automata 0.1.10",
]
[[package]]
@@ -1949,9 +1949,9 @@ dependencies = [
[[package]]
name = "mimalloc"
version = "0.1.48"
version = "0.1.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8"
checksum = "b1791cbe101e95af5764f06f20f6760521f7158f69dbf9d6baf941ee1bf6bc40"
dependencies = [
"libmimalloc-sys",
]
@@ -2074,11 +2074,12 @@ checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d"
[[package]]
name = "nu-ansi-term"
version = "0.50.1"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399"
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
dependencies = [
"windows-sys 0.52.0",
"overload",
"winapi",
]
[[package]]
@@ -2153,6 +2154,12 @@ dependencies = [
"memchr",
]
[[package]]
name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "parking_lot"
version = "0.12.4"
@@ -2681,8 +2688,17 @@ checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
"regex-automata 0.4.10",
"regex-syntax 0.8.5",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax 0.6.29",
]
[[package]]
@@ -2693,7 +2709,7 @@ checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
"regex-syntax 0.8.5",
]
[[package]]
@@ -2702,6 +2718,12 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
version = "0.8.5"
@@ -2721,7 +2743,7 @@ dependencies = [
[[package]]
name = "ruff"
version = "0.12.11"
version = "0.12.10"
dependencies = [
"anyhow",
"argfile",
@@ -2848,7 +2870,6 @@ dependencies = [
"insta",
"matchit",
"path-slash",
"pathdiff",
"quick-junit",
"ruff_annotate_snippets",
"ruff_cache",
@@ -2977,7 +2998,7 @@ dependencies = [
[[package]]
name = "ruff_linter"
version = "0.12.11"
version = "0.12.10"
dependencies = [
"aho-corasick",
"anyhow",
@@ -2999,6 +3020,7 @@ dependencies = [
"memchr",
"natord",
"path-absolutize",
"pathdiff",
"pep440_rs",
"pyproject-toml",
"regex",
@@ -3315,7 +3337,7 @@ dependencies = [
[[package]]
name = "ruff_wasm"
version = "0.12.11"
version = "0.12.10"
dependencies = [
"console_error_panic_hook",
"console_log",
@@ -3412,7 +3434,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.60.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -4139,15 +4161,15 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
version = "0.3.20"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
dependencies = [
"chrono",
"matchers",
"nu-ansi-term",
"once_cell",
"regex-automata",
"regex",
"sharded-slab",
"smallvec",
"thread_local",
@@ -4219,7 +4241,6 @@ name = "ty_ide"
version = "0.0.0"
dependencies = [
"bitflags 2.9.3",
"camino",
"get-size2",
"insta",
"itertools 0.14.0",
@@ -4257,7 +4278,7 @@ dependencies = [
"pep440_rs",
"rayon",
"regex",
"regex-automata",
"regex-automata 0.4.10",
"ruff_cache",
"ruff_db",
"ruff_macros",
@@ -4871,6 +4892,22 @@ dependencies = [
"glob",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.9"
@@ -4880,6 +4917,12 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.61.2"
@@ -4939,15 +4982,6 @@ dependencies = [
"windows-link",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.59.0"

1160
LICENSE

File diff suppressed because it is too large Load Diff

View File

@@ -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.11/install.sh | sh
powershell -c "irm https://astral.sh/ruff/0.12.11/install.ps1 | iex"
curl -LsSf https://astral.sh/ruff/0.12.10/install.sh | sh
powershell -c "irm https://astral.sh/ruff/0.12.10/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.11
rev: v0.12.10
hooks:
# Run the linter.
- id: ruff-check

View File

@@ -1,6 +1,6 @@
[package]
name = "ruff"
version = "0.12.11"
version = "0.12.10"
publish = true
authors = { workspace = true }
edition = { workspace = true }

View File

@@ -15,7 +15,8 @@ use ruff_db::diagnostic::{
use ruff_linter::fs::relativize_path;
use ruff_linter::logging::LogLevel;
use ruff_linter::message::{
Emitter, EmitterContext, GithubEmitter, GroupedEmitter, SarifEmitter, TextEmitter,
Emitter, EmitterContext, GithubEmitter, GitlabEmitter, GroupedEmitter, SarifEmitter,
TextEmitter,
};
use ruff_linter::notify_user;
use ruff_linter::settings::flags::{self};
@@ -30,6 +31,8 @@ bitflags! {
const SHOW_VIOLATIONS = 1 << 0;
/// Whether to show a summary of the fixed violations when emitting diagnostics.
const SHOW_FIX_SUMMARY = 1 << 1;
/// Whether to show a diff of each fixed violation when emitting diagnostics.
const SHOW_FIX_DIFF = 1 << 2;
}
}
@@ -258,9 +261,9 @@ impl Printer {
OutputFormat::Concise | OutputFormat::Full => {
TextEmitter::default()
.with_show_fix_status(show_fix_status(self.fix_mode, fixables.as_ref()))
.with_show_fix_diff(self.format == OutputFormat::Full && preview)
.with_show_fix_diff(self.flags.intersects(Flags::SHOW_FIX_DIFF))
.with_show_source(self.format == OutputFormat::Full)
.with_fix_applicability(self.unsafe_fixes.required_applicability())
.with_unsafe_fixes(self.unsafe_fixes)
.with_preview(preview)
.emit(writer, &diagnostics.inner, &context)?;
@@ -293,11 +296,7 @@ impl Printer {
GithubEmitter.emit(writer, &diagnostics.inner, &context)?;
}
OutputFormat::Gitlab => {
let config = DisplayDiagnosticConfig::default()
.format(DiagnosticFormat::Gitlab)
.preview(preview);
let value = DisplayDiagnostics::new(&context, &config, &diagnostics.inner);
write!(writer, "{value}")?;
GitlabEmitter::default().emit(writer, &diagnostics.inner, &context)?;
}
OutputFormat::Pylint => {
let config = DisplayDiagnosticConfig::default()
@@ -462,7 +461,7 @@ impl Printer {
TextEmitter::default()
.with_show_fix_status(show_fix_status(self.fix_mode, fixables.as_ref()))
.with_show_source(preview)
.with_fix_applicability(self.unsafe_fixes.required_applicability())
.with_unsafe_fixes(self.unsafe_fixes)
.emit(writer, &diagnostics.inner, &context)?;
}
writer.flush()?;

View File

@@ -5830,33 +5830,3 @@ nested_optional: Optional[Optional[Optional[str]]] = None
",
);
}
#[test]
fn show_fixes_in_full_output_with_preview_enabled() {
assert_cmd_snapshot!(
Command::new(get_cargo_bin(BIN_NAME))
.args(["check", "--no-cache", "--output-format", "full"])
.args(["--select", "F401"])
.arg("--preview")
.arg("-")
.pass_stdin("import math"),
@r"
success: false
exit_code: 1
----- stdout -----
F401 [*] `math` imported but unused
--> -:1:8
|
1 | import math
| ^^^^
|
help: Remove unused import: `math`
- import math
Found 1 error.
[*] 1 fixable with the `--fix` option.
----- stderr -----
",
);
}

View File

@@ -20,59 +20,59 @@ exit_code: 1
{
"check_name": "F401",
"description": "F401: `os` imported but unused",
"severity": "major",
"fingerprint": "4dbad37161e65c72",
"location": {
"path": "input.py",
"positions": {
"begin": {
"line": 1,
"column": 8
"column": 8,
"line": 1
},
"end": {
"line": 1,
"column": 10
"column": 10,
"line": 1
}
}
}
},
"severity": "major"
},
{
"check_name": "F821",
"description": "F821: Undefined name `y`",
"severity": "major",
"fingerprint": "7af59862a085230",
"location": {
"path": "input.py",
"positions": {
"begin": {
"line": 2,
"column": 5
"column": 5,
"line": 2
},
"end": {
"line": 2,
"column": 6
"column": 6,
"line": 2
}
}
}
},
"severity": "major"
},
{
"check_name": "invalid-syntax",
"description": "invalid-syntax: Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)",
"severity": "major",
"fingerprint": "e558cec859bb66e8",
"location": {
"path": "input.py",
"positions": {
"begin": {
"line": 3,
"column": 1
"column": 1,
"line": 3
},
"end": {
"line": 3,
"column": 6
"column": 6,
"line": 3
}
}
}
},
"severity": "major"
}
]
----- stderr -----

View File

@@ -450,6 +450,9 @@ fn benchmark_complex_constrained_attributes_2(criterion: &mut Criterion) {
r#"
class C:
def f(self: "C"):
self.a = ""
self.b = ""
if isinstance(self.a, str):
return
@@ -463,56 +466,6 @@ fn benchmark_complex_constrained_attributes_2(criterion: &mut Criterion) {
return
if isinstance(self.b, str):
return
if isinstance(self.b, str):
return
if isinstance(self.b, str):
return
self.a = ""
self.b = ""
"#,
)
},
|case| {
let Case { db, .. } = case;
let result = db.check();
assert_eq!(result.len(), 0);
},
BatchSize::SmallInput,
);
});
}
fn benchmark_complex_constrained_attributes_3(criterion: &mut Criterion) {
setup_rayon();
criterion.bench_function("ty_micro[complex_constrained_attributes_3]", |b| {
b.iter_batched_ref(
|| {
// This is a regression test for https://github.com/astral-sh/ty/issues/758
setup_micro_case(
r#"
class GridOut:
def __init__(self: "GridOut") -> None:
self._buffer = b""
def _read_size_or_line(self: "GridOut", size: int = -1):
if size > self._position:
size = self._position
pass
if size == 0:
return bytes()
while size > 0:
if self._buffer:
buf = self._buffer
self._buffer = b""
else:
buf = b""
if len(buf) > size:
self._buffer = buf
self._position -= len(self._buffer)
"#,
)
},
@@ -715,7 +668,6 @@ criterion_group!(
benchmark_tuple_implicit_instance_attributes,
benchmark_complex_constrained_attributes_1,
benchmark_complex_constrained_attributes_2,
benchmark_complex_constrained_attributes_3,
benchmark_many_enum_members,
);
criterion_group!(project, anyio, attrs, hydra, datetype);

View File

@@ -34,7 +34,6 @@ glob = { workspace = true }
ignore = { workspace = true, optional = true }
matchit = { workspace = true }
path-slash = { workspace = true }
pathdiff = { workspace = true }
quick-junit = { workspace = true, optional = true }
rustc-hash = { workspace = true }
salsa = { workspace = true }
@@ -54,7 +53,7 @@ web-time = { version = "1.1.0" }
etcetera = { workspace = true, optional = true }
[dev-dependencies]
insta = { workspace = true, features = ["filters"] }
insta = { workspace = true }
tempfile = { workspace = true }
[features]

View File

@@ -349,13 +349,6 @@ impl Diagnostic {
self.fix().is_some()
}
/// Returns `true` if the diagnostic is [`fixable`](Diagnostic::fixable) and applies at the
/// configured applicability level.
pub fn has_applicable_fix(&self, config: &DisplayDiagnosticConfig) -> bool {
self.fix()
.is_some_and(|fix| fix.applies(config.fix_applicability))
}
/// Returns the offset of the parent statement for this diagnostic if it exists.
///
/// This is primarily used for checking noqa/secondary code suppressions.
@@ -1442,11 +1435,6 @@ pub enum DiagnosticFormat {
/// Print diagnostics in the format expected by JUnit.
#[cfg(feature = "junit")]
Junit,
/// Print diagnostics in the JSON format used by GitLab [Code Quality] reports.
///
/// [Code Quality]: https://docs.gitlab.com/ci/testing/code_quality/#code-quality-report-format
#[cfg(feature = "serde")]
Gitlab,
}
/// A representation of the kinds of messages inside a diagnostic.

View File

@@ -31,8 +31,6 @@ mod azure;
mod concise;
mod full;
#[cfg(feature = "serde")]
mod gitlab;
#[cfg(feature = "serde")]
mod json;
#[cfg(feature = "serde")]
mod json_lines;
@@ -138,10 +136,6 @@ impl std::fmt::Display for DisplayDiagnostics<'_> {
DiagnosticFormat::Junit => {
junit::JunitRenderer::new(self.resolver).render(f, self.diagnostics)?;
}
#[cfg(feature = "serde")]
DiagnosticFormat::Gitlab => {
gitlab::GitlabRenderer::new(self.resolver).render(f, self.diagnostics)?;
}
}
Ok(())
@@ -254,7 +248,9 @@ impl<'a> ResolvedDiagnostic<'a> {
id,
message: diag.inner.message.as_str().to_string(),
annotations,
is_fixable: diag.has_applicable_fix(config),
is_fixable: diag
.fix()
.is_some_and(|fix| fix.applies(config.fix_applicability)),
}
}

View File

@@ -77,9 +77,11 @@ impl<'a> ConciseRenderer<'a> {
)?;
}
if self.config.show_fix_status {
// Do not display an indicator for inapplicable fixes
if diag.has_applicable_fix(self.config) {
write!(f, "[{fix}] ", fix = fmt_styled("*", stylesheet.separator))?;
if let Some(fix) = diag.fix() {
// Do not display an indicator for inapplicable fixes
if fix.applies(self.config.fix_applicability) {
write!(f, "[{fix}] ", fix = fmt_styled("*", stylesheet.separator))?;
}
}
}
} else {

View File

@@ -1,11 +1,12 @@
use std::borrow::Cow;
use std::num::NonZeroUsize;
use anstyle::Style;
use ruff_notebook::NotebookIndex;
use similar::{ChangeTag, TextDiff};
use ruff_annotate_snippets::Renderer as AnnotateRenderer;
use ruff_diagnostics::{Applicability, Fix};
use ruff_notebook::NotebookIndex;
use ruff_source_file::OneIndexed;
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
@@ -57,14 +58,13 @@ impl<'a> FullRenderer<'a> {
for diag in renderable.diagnostics.iter() {
writeln!(f, "{}", renderer.render(diag.to_annotate()))?;
}
writeln!(f)?;
if self.config.show_fix_diff && diag.has_applicable_fix(self.config) {
if self.config.show_fix_diff {
if let Some(diff) = Diff::from_diagnostic(diag, &stylesheet, self.resolver) {
write!(f, "{diff}")?;
writeln!(f, "{diff}")?;
}
}
writeln!(f)?;
}
Ok(())
@@ -126,6 +126,19 @@ impl std::fmt::Display for Diff<'_> {
vec![(None, source_text.text_len())]
};
let message = match self.fix.applicability() {
// TODO(zanieb): Adjust this messaging once it's user-facing
Applicability::Safe => "Safe fix",
Applicability::Unsafe => "Unsafe fix",
Applicability::DisplayOnly => "Display-only fix",
};
// TODO(brent) `stylesheet.separator` is cyan rather than blue, as we had before. I think
// we're getting rid of this soon anyway, so I didn't think it was worth adding another
// style to the stylesheet temporarily. The color doesn't appear at all in the snapshot
// tests, which is the only place these are currently used.
writeln!(f, " {}", fmt_styled(message, self.stylesheet.separator))?;
let mut last_end = TextSize::ZERO;
for (cell, offset) in cells {
let range = TextRange::new(last_end, offset);
@@ -154,67 +167,64 @@ impl std::fmt::Display for Diff<'_> {
let diff = TextDiff::from_lines(input, &output);
let grouped_ops = diff.grouped_ops(3);
let (largest_old, largest_new) = diff
.ops()
.last()
.map(|op| (op.old_range().start, op.new_range().start))
.unwrap_or_default();
// Find the new line number with the largest number of digits to align all of the line
// number separators.
let last_op = grouped_ops.last().and_then(|group| group.last());
let largest_new = last_op.map(|op| op.new_range().end).unwrap_or_default();
let digit_with = OneIndexed::new(largest_new).unwrap_or_default().digits();
let digit_with = OneIndexed::from_zero_indexed(largest_new.max(largest_old)).digits();
if let Some(cell) = cell {
// Room for 1 digit, 1 space, 1 `|`, and 1 more following space. This centers the
// three colons on the pipe.
writeln!(f, "{:>1$} cell {cell}", ":::", digit_with.get() + 3)?;
// Room for 2 digits, 2 x 1 space before each digit, 1 space, and 1 `|`. This
// centers the three colons on the pipe.
writeln!(f, "{:>1$} cell {cell}", ":::", 2 * digit_with.get() + 4)?;
}
for (idx, group) in grouped_ops.iter().enumerate() {
for (idx, group) in diff.grouped_ops(3).iter().enumerate() {
if idx > 0 {
writeln!(f, "{:-^1$}", "-", 80)?;
}
for op in group {
for change in diff.iter_inline_changes(op) {
let (sign, style, line_no_style, index) = match change.tag() {
ChangeTag::Delete => (
"-",
self.stylesheet.deletion,
self.stylesheet.deletion_line_no,
None,
),
ChangeTag::Insert => (
"+",
self.stylesheet.insertion,
self.stylesheet.insertion_line_no,
change.new_index(),
),
ChangeTag::Equal => (
"|",
self.stylesheet.none,
self.stylesheet.line_no,
change.new_index(),
),
let sign = match change.tag() {
ChangeTag::Delete => "-",
ChangeTag::Insert => "+",
ChangeTag::Equal => " ",
};
let line = Line {
index: index.map(OneIndexed::from_zero_indexed),
width: digit_with,
};
let line_style = LineStyle::from(change.tag(), self.stylesheet);
let old_index = change.old_index().map(OneIndexed::from_zero_indexed);
let new_index = change.new_index().map(OneIndexed::from_zero_indexed);
write!(
f,
"{line} {sign} ",
line = fmt_styled(line, self.stylesheet.line_no),
sign = fmt_styled(sign, line_no_style),
"{} {} |{}",
Line {
index: old_index,
width: digit_with,
},
Line {
index: new_index,
width: digit_with,
},
fmt_styled(line_style.apply_to(sign), self.stylesheet.emphasis),
)?;
for (emphasized, value) in change.iter_strings_lossy() {
let value = show_nonprinting(&value);
let styled = fmt_styled(value, style);
if emphasized {
write!(f, "{}", fmt_styled(styled, self.stylesheet.emphasis))?;
write!(
f,
"{}",
fmt_styled(
line_style.apply_to(&value),
self.stylesheet.underline
)
)?;
} else {
write!(f, "{styled}")?;
write!(f, "{}", line_style.apply_to(&value))?;
}
}
if change.missing_newline() {
@@ -225,38 +235,34 @@ impl std::fmt::Display for Diff<'_> {
}
}
match self.fix.applicability() {
Applicability::Safe => {}
Applicability::Unsafe => {
writeln!(
f,
"{note}: {msg}",
note = fmt_styled("note", self.stylesheet.warning),
msg = fmt_styled(
"This is an unsafe fix and may change runtime behavior",
self.stylesheet.emphasis
)
)?;
}
Applicability::DisplayOnly => {
// Note that this is still only used in tests. There's no `--display-only-fixes`
// analog to `--unsafe-fixes` for users to activate this or see the styling.
writeln!(
f,
"{note}: {msg}",
note = fmt_styled("note", self.stylesheet.error),
msg = fmt_styled(
"This is a display-only fix and is likely to be incorrect",
self.stylesheet.emphasis
)
)?;
}
}
Ok(())
}
}
struct LineStyle {
style: Style,
}
impl LineStyle {
fn apply_to(&self, input: &str) -> impl std::fmt::Display {
fmt_styled(input, self.style)
}
fn from(value: ChangeTag, stylesheet: &DiagnosticStylesheet) -> LineStyle {
match value {
ChangeTag::Equal => LineStyle {
style: stylesheet.none,
},
ChangeTag::Delete => LineStyle {
style: stylesheet.deletion,
},
ChangeTag::Insert => LineStyle {
style: stylesheet.insertion,
},
}
}
}
struct Line {
index: Option<OneIndexed>,
width: NonZeroUsize,
@@ -291,7 +297,7 @@ fn show_nonprinting(s: &str) -> Cow<'_, str> {
#[cfg(test)]
mod tests {
use ruff_diagnostics::{Applicability, Edit, Fix};
use ruff_diagnostics::{Applicability, Fix};
use ruff_text_size::{TextLen, TextRange, TextSize};
use crate::diagnostic::{
@@ -697,8 +703,6 @@ print()
fn notebook_output_with_diff() {
let (mut env, diagnostics) = create_notebook_diagnostics(DiagnosticFormat::Full);
env.show_fix_diff(true);
env.fix_applicability(Applicability::DisplayOnly);
insta::assert_snapshot!(env.render_diagnostics(&diagnostics), @r"
error[unused-import][*]: `os` imported but unused
--> notebook.ipynb:cell 1:2:8
@@ -708,9 +712,11 @@ print()
| ^^
|
help: Remove unused import: `os`
::: cell 1
1 | # cell 1
- import os
Safe fix
::: cell 1
1 1 | # cell 1
2 |-import os
error[unused-import][*]: `math` imported but unused
--> notebook.ipynb:cell 2:2:8
@@ -722,13 +728,15 @@ print()
4 | print('hello world')
|
help: Remove unused import: `math`
::: cell 2
1 | # cell 2
- import math
2 |
3 | print('hello world')
error[unused-variable][*]: Local variable `x` is assigned to but never used
Safe fix
::: cell 2
1 1 | # cell 2
2 |-import math
3 2 |
4 3 | print('hello world')
error[unused-variable]: Local variable `x` is assigned to but never used
--> notebook.ipynb:cell 3:4:5
|
2 | def foo():
@@ -737,13 +745,14 @@ print()
| ^
|
help: Remove assignment to unused variable `x`
::: cell 3
1 | # cell 3
2 | def foo():
3 | print()
- x = 1
4 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
::: cell 3
1 1 | # cell 3
2 2 | def foo():
3 3 | print()
4 |- x = 1
5 4 |
");
}
@@ -751,7 +760,6 @@ print()
fn notebook_output_with_diff_spanning_cells() {
let (mut env, mut diagnostics) = create_notebook_diagnostics(DiagnosticFormat::Full);
env.show_fix_diff(true);
env.fix_applicability(Applicability::DisplayOnly);
// Move all of the edits from the later diagnostics to the first diagnostic to simulate a
// single diagnostic with edits in different cells.
@@ -764,7 +772,7 @@ print()
*fix = Fix::unsafe_edits(edits.remove(0), edits);
insta::assert_snapshot!(env.render(&diagnostic), @r"
error[unused-import][*]: `os` imported but unused
error[unused-import]: `os` imported but unused
--> notebook.ipynb:cell 1:2:8
|
1 | # cell 1
@@ -772,21 +780,22 @@ print()
| ^^
|
help: Remove unused import: `os`
::: cell 1
1 | # cell 1
- import os
::: cell 2
1 | # cell 2
- import math
2 |
3 | print('hello world')
::: cell 3
1 | # cell 3
2 | def foo():
3 | print()
- x = 1
4 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
::: cell 1
1 1 | # cell 1
2 |-import os
::: cell 2
1 1 | # cell 2
2 |-import math
3 2 |
4 3 | print('hello world')
::: cell 3
1 1 | # cell 3
2 2 | def foo():
3 3 | print()
4 |- x = 1
5 4 |
");
}
@@ -892,74 +901,4 @@ print()
|
");
}
/// Test that we handle the width calculation for the line number correctly even for context
/// lines at the end of a diff. For example, we want it to render like this:
///
/// ```
/// 8 |
/// 9 |
/// 10 |
/// ```
///
/// and not like this:
///
/// ```
/// 8 |
/// 9 |
/// 10 |
/// ```
#[test]
fn longer_line_number_end_of_context() {
let mut env = TestEnvironment::new();
let contents = "\
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
";
env.add("example.py", contents);
env.format(DiagnosticFormat::Full);
env.show_fix_diff(true);
env.fix_applicability(Applicability::DisplayOnly);
let mut diagnostic = env.err().primary("example.py", "3", "3", "label").build();
diagnostic.help("Start of diff:");
let target = "line 7";
let line9 = contents.find(target).unwrap();
let range = TextRange::at(TextSize::try_from(line9).unwrap(), target.text_len());
diagnostic.set_fix(Fix::unsafe_edit(Edit::range_replacement(
format!("fixed {target}"),
range,
)));
insta::assert_snapshot!(env.render(&diagnostic), @r"
error[test-diagnostic][*]: main diagnostic message
--> example.py:3:1
|
1 | line 1
2 | line 2
3 | line 3
| ^^^^^^ label
4 | line 4
5 | line 5
|
help: Start of diff:
4 | line 4
5 | line 5
6 | line 6
- line 7
7 + fixed line 7
8 | line 8
9 | line 9
10 | line 10
note: This is an unsafe fix and may change runtime behavior
");
}
}

View File

@@ -1,205 +0,0 @@
use std::{
collections::HashSet,
hash::{DefaultHasher, Hash, Hasher},
path::Path,
};
use ruff_source_file::LineColumn;
use serde::{Serialize, Serializer, ser::SerializeSeq};
use crate::diagnostic::{Diagnostic, Severity};
use super::FileResolver;
pub(super) struct GitlabRenderer<'a> {
resolver: &'a dyn FileResolver,
}
impl<'a> GitlabRenderer<'a> {
pub(super) fn new(resolver: &'a dyn FileResolver) -> Self {
Self { resolver }
}
}
impl GitlabRenderer<'_> {
pub(super) fn render(
&self,
f: &mut std::fmt::Formatter,
diagnostics: &[Diagnostic],
) -> std::fmt::Result {
write!(
f,
"{}",
serde_json::to_string_pretty(&SerializedMessages {
diagnostics,
resolver: self.resolver,
#[expect(
clippy::disallowed_methods,
reason = "We don't have access to a `System` here, \
and this is only intended for use by GitLab CI, \
which runs on a real `System`."
)]
project_dir: std::env::var("CI_PROJECT_DIR").ok().as_deref(),
})
.unwrap()
)
}
}
struct SerializedMessages<'a> {
diagnostics: &'a [Diagnostic],
resolver: &'a dyn FileResolver,
project_dir: Option<&'a str>,
}
impl Serialize for SerializedMessages<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let mut s = serializer.serialize_seq(Some(self.diagnostics.len()))?;
let mut fingerprints = HashSet::<u64>::with_capacity(self.diagnostics.len());
for diagnostic in self.diagnostics {
let location = diagnostic
.primary_span()
.map(|span| {
let file = span.file();
let positions = if self.resolver.is_notebook(file) {
// We can't give a reasonable location for the structured formats,
// so we show one that's clearly a fallback
Default::default()
} else {
let diagnostic_source = file.diagnostic_source(self.resolver);
let source_code = diagnostic_source.as_source_code();
span.range()
.map(|range| Positions {
begin: source_code.line_column(range.start()),
end: source_code.line_column(range.end()),
})
.unwrap_or_default()
};
let path = self.project_dir.as_ref().map_or_else(
|| file.relative_path(self.resolver).display().to_string(),
|project_dir| relativize_path_to(file.path(self.resolver), project_dir),
);
Location { path, positions }
})
.unwrap_or_default();
let mut message_fingerprint = fingerprint(diagnostic, &location.path, 0);
// Make sure that we do not get a fingerprint that is already in use
// by adding in the previously generated one.
while fingerprints.contains(&message_fingerprint) {
message_fingerprint = fingerprint(diagnostic, &location.path, message_fingerprint);
}
fingerprints.insert(message_fingerprint);
let description = diagnostic.body();
let check_name = diagnostic.secondary_code_or_id();
let severity = match diagnostic.severity() {
Severity::Info => "info",
Severity::Warning => "minor",
Severity::Error => "major",
// Another option here is `blocker`
Severity::Fatal => "critical",
};
let value = Message {
check_name,
// 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,
fingerprint: format!("{:x}", message_fingerprint),
location,
};
s.serialize_element(&value)?;
}
s.end()
}
}
#[derive(Serialize)]
struct Message<'a> {
check_name: &'a str,
description: String,
severity: &'static str,
fingerprint: String,
location: Location,
}
/// The place in the source code where the issue was discovered.
///
/// According to the CodeClimate report format [specification] linked from the GitLab [docs], this
/// field is required, so we fall back on a default `path` and position if the diagnostic doesn't
/// have a primary span.
///
/// [specification]: https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types
/// [docs]: https://docs.gitlab.com/ci/testing/code_quality/#code-quality-report-format
#[derive(Default, Serialize)]
struct Location {
path: String,
positions: Positions,
}
#[derive(Default, Serialize)]
struct Positions {
begin: LineColumn,
end: LineColumn,
}
/// Generate a unique fingerprint to identify a violation.
fn fingerprint(diagnostic: &Diagnostic, project_path: &str, salt: u64) -> u64 {
let mut hasher = DefaultHasher::new();
salt.hash(&mut hasher);
diagnostic.name().hash(&mut hasher);
project_path.hash(&mut hasher);
hasher.finish()
}
/// Convert an absolute path to be relative to the specified project root.
fn relativize_path_to<P: AsRef<Path>, R: AsRef<Path>>(path: P, project_root: R) -> String {
format!(
"{}",
pathdiff::diff_paths(&path, project_root)
.expect("Could not diff paths")
.display()
)
}
#[cfg(test)]
mod tests {
use crate::diagnostic::{
DiagnosticFormat,
render::tests::{create_diagnostics, create_syntax_error_diagnostics},
};
const FINGERPRINT_FILTERS: [(&str, &str); 1] = [(
r#""fingerprint": "[a-z0-9]+","#,
r#""fingerprint": "<redacted>","#,
)];
#[test]
fn output() {
let (env, diagnostics) = create_diagnostics(DiagnosticFormat::Gitlab);
insta::with_settings!({filters => FINGERPRINT_FILTERS}, {
insta::assert_snapshot!(env.render_diagnostics(&diagnostics));
});
}
#[test]
fn syntax_errors() {
let (env, diagnostics) = create_syntax_error_diagnostics(DiagnosticFormat::Gitlab);
insta::with_settings!({filters => FINGERPRINT_FILTERS}, {
insta::assert_snapshot!(env.render_diagnostics(&diagnostics));
});
}
}

View File

@@ -40,13 +40,12 @@ pub struct DiagnosticStylesheet {
pub(crate) help: Style,
pub(crate) line_no: Style,
pub(crate) emphasis: Style,
pub(crate) underline: Style,
pub(crate) none: Style,
pub(crate) separator: Style,
pub(crate) secondary_code: Style,
pub(crate) insertion: Style,
pub(crate) deletion: Style,
pub(crate) insertion_line_no: Style,
pub(crate) deletion_line_no: Style,
}
impl Default for DiagnosticStylesheet {
@@ -67,13 +66,12 @@ impl DiagnosticStylesheet {
help: AnsiColor::BrightCyan.on_default().effects(Effects::BOLD),
line_no: bright_blue.effects(Effects::BOLD),
emphasis: Style::new().effects(Effects::BOLD),
underline: Style::new().effects(Effects::UNDERLINE),
none: Style::new(),
separator: AnsiColor::Cyan.on_default(),
secondary_code: AnsiColor::Red.on_default().effects(Effects::BOLD),
insertion: AnsiColor::Green.on_default(),
deletion: AnsiColor::Red.on_default(),
insertion_line_no: AnsiColor::Green.on_default().effects(Effects::BOLD),
deletion_line_no: AnsiColor::Red.on_default().effects(Effects::BOLD),
}
}
@@ -86,13 +84,12 @@ impl DiagnosticStylesheet {
help: Style::new(),
line_no: Style::new(),
emphasis: Style::new(),
underline: Style::new(),
none: Style::new(),
separator: Style::new(),
secondary_code: Style::new(),
insertion: Style::new(),
deletion: Style::new(),
insertion_line_no: Style::new(),
deletion_line_no: Style::new(),
}
}
}

View File

@@ -1,6 +1,6 @@
[package]
name = "ruff_linter"
version = "0.12.11"
version = "0.12.10"
publish = false
authors = { workspace = true }
edition = { workspace = true }
@@ -51,6 +51,7 @@ path-absolutize = { workspace = true, features = [
"once_cell_cache",
"use_unix_paths_on_wasm",
] }
pathdiff = { workspace = true }
pep440_rs = { workspace = true }
pyproject-toml = { workspace = true }
regex = { workspace = true }

View File

@@ -12,7 +12,6 @@ from airflow import (
from airflow.api_connexion.security import requires_access
from airflow.contrib.aws_athena_hook import AWSAthenaHook
from airflow.datasets import DatasetAliasEvent
from airflow.operators.postgres_operator import Mapping
from airflow.operators.subdag import SubDagOperator
from airflow.secrets.cache import SecretCache
from airflow.secrets.local_filesystem import LocalFilesystemBackend
@@ -53,8 +52,6 @@ DatasetAliasEvent()
# airflow.operators.subdag.*
SubDagOperator()
# airflow.operators.postgres_operator
Mapping()
# airflow.secrets
# get_connection

View File

@@ -70,40 +70,7 @@ from airflow.timetables.datasets import DatasetOrTimeSchedule
from airflow.utils.dag_parsing_context import get_parsing_context
# airflow.timetables.datasets
DatasetOrTimeSchedule(datasets=[])
DatasetOrTimeSchedule()
# airflow.utils.dag_parsing_context
get_parsing_context()
from airflow.decorators.base import (
DecoratedMappedOperator,
DecoratedOperator,
TaskDecorator,
get_unique_task_id,
task_decorator_factory,
)
# airflow.decorators.base
DecoratedMappedOperator()
DecoratedOperator()
TaskDecorator()
get_unique_task_id()
task_decorator_factory()
from airflow.models import Param
# airflow.models
Param()
from airflow.sensors.base import (
BaseSensorOperator,
PokeReturnValue,
poke_mode_only,
)
# airflow.sensors.base
BaseSensorOperator()
PokeReturnValue()
poke_mode_only()

View File

@@ -9,6 +9,7 @@ from airflow.operators.empty import EmptyOperator
from airflow.operators.latest_only import LatestOnlyOperator
from airflow.operators.trigger_dagrun import TriggerDagRunOperator
from airflow.operators.weekday import BranchDayOfWeekOperator
from airflow.sensors.date_time import DateTimeSensor
FSHook()
PackageIndexHook()
@@ -21,6 +22,7 @@ EmptyOperator()
LatestOnlyOperator()
BranchDayOfWeekOperator()
DateTimeSensor()
from airflow.operators.python import (
BranchPythonOperator,
@@ -28,23 +30,16 @@ from airflow.operators.python import (
PythonVirtualenvOperator,
ShortCircuitOperator,
)
from airflow.sensors.bash import BashSensor
from airflow.sensors.date_time import DateTimeSensor
BranchPythonOperator()
PythonOperator()
PythonVirtualenvOperator()
ShortCircuitOperator()
BashSensor()
DateTimeSensor()
from airflow.sensors.date_time import DateTimeSensorAsync
from airflow.sensors.external_task import (
ExternalTaskMarker,
ExternalTaskSensor,
)
from airflow.sensors.time_sensor import (
TimeSensor,
TimeSensorAsync,
)
from airflow.sensors.filesystem import FileSensor
from airflow.sensors.python import PythonSensor
BranchPythonOperator()
PythonOperator()
@@ -54,13 +49,6 @@ DateTimeSensorAsync()
ExternalTaskMarker()
ExternalTaskSensor()
FileSensor()
PythonSensor()
from airflow.sensors.time_sensor import (
TimeSensor,
TimeSensorAsync,
)
TimeSensor()
TimeSensorAsync()

View File

@@ -213,17 +213,3 @@ async def get_id_pydantic_full(
async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
@app.get("/{my_id}")
async def get_id_init_not_annotated(params = Depends(InitParams)): ...
@app.get("/things/{ thing_id }")
async def read_thing(query: str):
return {"query": query}
@app.get("/things/{ thing_id : path }")
async def read_thing(query: str):
return {"query": query}
@app.get("/things/{ thing_id : str }")
async def read_thing(query: str):
return {"query": query}

View File

@@ -1,75 +0,0 @@
from typing import Optional
import httpx
def foo():
client = httpx.Client()
client.close() # Ok
client.delete() # Ok
client.get() # Ok
client.head() # Ok
client.options() # Ok
client.patch() # Ok
client.post() # Ok
client.put() # Ok
client.request() # Ok
client.send() # Ok
client.stream() # Ok
client.anything() # Ok
client.build_request() # Ok
client.is_closed # Ok
async def foo():
client = httpx.Client()
client.close() # ASYNC212
client.delete() # ASYNC212
client.get() # ASYNC212
client.head() # ASYNC212
client.options() # ASYNC212
client.patch() # ASYNC212
client.post() # ASYNC212
client.put() # ASYNC212
client.request() # ASYNC212
client.send() # ASYNC212
client.stream() # ASYNC212
client.anything() # Ok
client.build_request() # Ok
client.is_closed # Ok
async def foo(client: httpx.Client):
client.request() # ASYNC212
client.anything() # Ok
async def foo(client: httpx.Client | None):
client.request() # ASYNC212
client.anything() # Ok
async def foo(client: Optional[httpx.Client]):
client.request() # ASYNC212
client.anything() # Ok
async def foo():
client: httpx.Client = ...
client.request() # ASYNC212
client.anything() # Ok
global_client = httpx.Client()
async def foo():
global_client.request() # ASYNC212
global_client.anything() # Ok
async def foo():
async with httpx.AsyncClient() as client:
await client.get() # Ok

View File

@@ -1,22 +0,0 @@
def foo():
k = input() # Ok
input("hello world") # Ok
async def foo():
k = input() # ASYNC250
input("hello world") # ASYNC250
import builtins
import fake
def foo():
builtins.input("testing") # Ok
async def foo():
builtins.input("testing") # ASYNC250
fake.input("whatever") # Ok

View File

@@ -75,7 +75,3 @@ list(map(lambda x, y: x, [(1, 2), (3, 4)]))
_ = t"{set(map(lambda x: x % 2 == 0, nums))}"
_ = t"{dict(map(lambda v: (v, v**2), nums))}"
# See https://github.com/astral-sh/ruff/issues/20198
# No error: lambda contains `yield`, so map() should not be rewritten
map(lambda x: (yield x), [1, 2, 3])

View File

@@ -17,50 +17,3 @@ info(f"{__name__}")
# Don't trigger for t-strings
info(t"{name}")
info(t"{__name__}")
count = 5
total = 9
directory_path = "/home/hamir/ruff/crates/ruff_linter/resources/test/"
logging.info(f"{count} out of {total} files in {directory_path} checked")
x = 99
fmt = "08d"
logger.info(f"{x:{'08d'}}")
logger.info(f"{x:>10} {x:{fmt}}")
logging.info(f"")
logging.info(f"This message doesn't have any variables.")
obj = {"key": "value"}
logging.info(f"Object: {obj!r}")
items_count = 3
logging.warning(f"Items: {items_count:d}")
data = {"status": "active"}
logging.info(f"Processing {len(data)} items")
logging.info(f"Status: {data.get('status', 'unknown').upper()}")
result = 123
logging.info(f"Calculated result: {result + 100}")
temperature = 123
logging.info(f"Temperature: {temperature:.1f}°C")
class FilePath:
def __init__(self, name: str):
self.name = name
logging.info(f"No changes made to {file_path.name}.")
user = "tron"
balance = 123.45
logging.error(f"Error {404}: User {user} has insufficient balance ${balance:.2f}")
import logging
x = 1
logging.error(f"{x} -> %s", x)

View File

@@ -1,10 +0,0 @@
"""Test f-string argument order."""
import logging
logger = logging.getLogger(__name__)
X = 1
Y = 2
logger.error(f"{X} -> %s", Y)
logger.error(f"{Y} -> %s", X)

View File

@@ -23,11 +23,3 @@ def test_error():
assert list([])
assert set(set())
assert tuple("")
# https://github.com/astral-sh/ruff/issues/19935
def test_all_ok():
assert f"{b""}"
assert f"{""=}"
assert f"{""!a}"
assert f"{""!r}"
assert f"{"":1}"

View File

@@ -192,24 +192,3 @@ def issue_19005_3():
c = {}
for a[0], a[1] in ():
c[a[0]] = a[1]
def issue_19153_1():
v = {}
for o, (x,) in ["ox"]:
v[x,] = o
return v
def issue_19153_2():
v = {}
for (o, p), x in [("op", "x")]:
v[x] = o, p
return v
def issue_19153_3():
v = {}
for o, (x,) in ["ox"]:
v[(x,)] = o
return v

View File

@@ -190,12 +190,3 @@ foo_tooltip = (
more
)
# https://github.com/astral-sh/ruff/issues/20097
def scope():
from collections.abc import Callable
from typing import ParamSpec
P = ParamSpec("P")
f1: Callable[P, str] = lambda x: str(x)
f2: Callable[..., str] = lambda x: str(x)

View File

@@ -1,16 +0,0 @@
"""
Test: allowed-unused-imports-top-level-module
"""
# No errors
def f():
import hvplot
def f():
import hvplot.pandas
def f():
import hvplot.pandas.plots
def f():
from hvplot.pandas import scatter_matrix
def f():
from hvplot.pandas.plots import scatter_matrix

View File

@@ -151,39 +151,3 @@ def f():
pass
except Exception as _:
pass
# OK, `__class__` in this case is not the special `__class__` cell, so we don't
# emit a diagnostic. (It has its own special semantics -- see
# https://github.com/astral-sh/ruff/pull/20048#discussion_r2298338048 -- but
# those aren't relevant here.)
class A:
__class__ = 1
# The following three cases are flagged because they declare local `__class__`
# variables that don't refer to the special `__class__` cell.
class A:
def set_class(self, cls):
__class__ = cls # F841
class A:
class B:
def set_class(self, cls):
__class__ = cls # F841
class A:
def foo():
class B:
print(__class__)
def set_class(self, cls):
__class__ = cls # F841
# OK, the `__class__` cell is nonlocal and declared as such.
class NonlocalDunderClass:
def foo():
nonlocal __class__
__class__ = 1

View File

@@ -4,9 +4,6 @@ print("שלום‬")
# E2502
example = "x" * 100 # "x" is assigned
# E2502
another = "x؜" * 50 # "؜x" is assigned
# E2502
if access_level != "none": # Check if admin ' and access_level != 'user
print("You are an admin.")

View File

@@ -44,8 +44,3 @@ def f():
def g():
nonlocal x
x = 2
# OK
class A:
def method(self):
nonlocal __class__

View File

@@ -124,19 +124,3 @@ def fun_with_python_syntax():
...
return Foo
@dataclass
class C:
def __post_init__(self, x: tuple[int, ...] = (
1,
2,
)) -> None:
self.x = x
@dataclass
class D:
def __post_init__(self, x: int = """
""") -> None:
self.x = x

View File

@@ -107,12 +107,3 @@ deque(f"{x}" "") # OK
deque(t"")
deque(t"" t"")
deque(t"{""}") # OK
# https://github.com/astral-sh/ruff/issues/20050
deque(f"{""}") # RUF037
deque(f"{b""}")
deque(f"{""=}")
deque(f"{""!a}")
deque(f"{""!r}")
deque(f"{"":1}")

View File

@@ -1 +0,0 @@
async def f(): yield from x # error

View File

@@ -660,9 +660,6 @@ pub(crate) fn expression(expr: &Expr, checker: &Checker) {
if checker.is_rule_enabled(Rule::BlockingHttpCallInAsyncFunction) {
flake8_async::rules::blocking_http_call(checker, call);
}
if checker.is_rule_enabled(Rule::BlockingHttpCallHttpxInAsyncFunction) {
flake8_async::rules::blocking_http_call_httpx(checker, call);
}
if checker.is_rule_enabled(Rule::BlockingOpenCallInAsyncFunction) {
flake8_async::rules::blocking_open_call(checker, call);
}
@@ -673,9 +670,6 @@ pub(crate) fn expression(expr: &Expr, checker: &Checker) {
]) {
flake8_async::rules::blocking_process_invocation(checker, call);
}
if checker.is_rule_enabled(Rule::BlockingInputInAsyncFunction) {
flake8_async::rules::blocking_input(checker, call);
}
if checker.is_rule_enabled(Rule::BlockingSleepInAsyncFunction) {
flake8_async::rules::blocking_sleep(checker, call);
}
@@ -1052,6 +1046,7 @@ pub(crate) fn expression(expr: &Expr, checker: &Checker) {
Rule::PyPath,
Rule::Glob,
Rule::OsListdir,
Rule::OsSymlink,
]) {
flake8_use_pathlib::rules::replaceable_by_pathlib(checker, call);
}
@@ -1319,10 +1314,13 @@ pub(crate) fn expression(expr: &Expr, checker: &Checker) {
pylint::rules::yield_in_init(checker, expr);
}
}
Expr::YieldFrom(_) => {
Expr::YieldFrom(yield_from) => {
if checker.is_rule_enabled(Rule::YieldInInit) {
pylint::rules::yield_in_init(checker, expr);
}
if checker.is_rule_enabled(Rule::YieldFromInAsyncFunction) {
pylint::rules::yield_from_in_async_function(checker, yield_from);
}
}
Expr::FString(f_string_expr @ ast::ExprFString { value, .. }) => {
if checker.is_rule_enabled(Rule::FStringMissingPlaceholders) {

View File

@@ -71,9 +71,7 @@ use crate::registry::Rule;
use crate::rules::pyflakes::rules::{
LateFutureImport, ReturnOutsideFunction, YieldOutsideFunction,
};
use crate::rules::pylint::rules::{
AwaitOutsideAsync, LoadBeforeGlobalDeclaration, YieldFromInAsyncFunction,
};
use crate::rules::pylint::rules::{AwaitOutsideAsync, LoadBeforeGlobalDeclaration};
use crate::rules::{flake8_pyi, flake8_type_checking, pyflakes, pyupgrade};
use crate::settings::rule_table::RuleTable;
use crate::settings::{LinterSettings, TargetVersion, flags};
@@ -670,12 +668,6 @@ impl SemanticSyntaxContext for Checker<'_> {
self.report_diagnostic(AwaitOutsideAsync, error.range);
}
}
SemanticSyntaxErrorKind::YieldFromInAsyncFunction => {
// PLE1700
if self.is_rule_enabled(Rule::YieldFromInAsyncFunction) {
self.report_diagnostic(YieldFromInAsyncFunction, error.range);
}
}
SemanticSyntaxErrorKind::ReboundComprehensionVariable
| SemanticSyntaxErrorKind::DuplicateTypeParameter
| SemanticSyntaxErrorKind::MultipleCaseAssignment(_)
@@ -711,10 +703,7 @@ impl SemanticSyntaxContext for Checker<'_> {
match scope.kind {
ScopeKind::Class(_) | ScopeKind::Lambda(_) => return false,
ScopeKind::Function(ast::StmtFunctionDef { is_async, .. }) => return *is_async,
ScopeKind::Generator { .. }
| ScopeKind::Module
| ScopeKind::Type
| ScopeKind::DunderClassCell => {}
ScopeKind::Generator { .. } | ScopeKind::Module | ScopeKind::Type => {}
}
}
false
@@ -725,10 +714,7 @@ impl SemanticSyntaxContext for Checker<'_> {
match scope.kind {
ScopeKind::Class(_) => return false,
ScopeKind::Function(_) | ScopeKind::Lambda(_) => return true,
ScopeKind::Generator { .. }
| ScopeKind::Module
| ScopeKind::Type
| ScopeKind::DunderClassCell => {}
ScopeKind::Generator { .. } | ScopeKind::Module | ScopeKind::Type => {}
}
}
false
@@ -739,7 +725,7 @@ impl SemanticSyntaxContext for Checker<'_> {
match scope.kind {
ScopeKind::Class(_) | ScopeKind::Generator { .. } => return false,
ScopeKind::Function(_) | ScopeKind::Lambda(_) => return true,
ScopeKind::Module | ScopeKind::Type | ScopeKind::DunderClassCell => {}
ScopeKind::Module | ScopeKind::Type => {}
}
}
false
@@ -1106,24 +1092,6 @@ impl<'a> Visitor<'a> for Checker<'a> {
}
}
// Here we add the implicit scope surrounding a method which allows code in the
// method to access `__class__` at runtime. See the `ScopeKind::DunderClassCell`
// docs for more information.
let added_dunder_class_scope = if self.semantic.current_scope().kind.is_class() {
self.semantic.push_scope(ScopeKind::DunderClassCell);
let binding_id = self.semantic.push_binding(
TextRange::default(),
BindingKind::DunderClassCell,
BindingFlags::empty(),
);
self.semantic
.current_scope_mut()
.add("__class__", binding_id);
true
} else {
false
};
self.semantic.push_scope(ScopeKind::Type);
if let Some(type_params) = type_params {
@@ -1187,9 +1155,6 @@ impl<'a> Visitor<'a> for Checker<'a> {
self.semantic.pop_scope(); // Function scope
self.semantic.pop_definition();
self.semantic.pop_scope(); // Type parameter scope
if added_dunder_class_scope {
self.semantic.pop_scope(); // `__class__` cell closure scope
}
self.add_binding(
name,
stmt.identifier(),

View File

@@ -336,12 +336,10 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
(Flake8Async, "115") => (RuleGroup::Stable, rules::flake8_async::rules::AsyncZeroSleep),
(Flake8Async, "116") => (RuleGroup::Preview, rules::flake8_async::rules::LongSleepNotForever),
(Flake8Async, "210") => (RuleGroup::Stable, rules::flake8_async::rules::BlockingHttpCallInAsyncFunction),
(Flake8Async, "212") => (RuleGroup::Preview, rules::flake8_async::rules::BlockingHttpCallHttpxInAsyncFunction),
(Flake8Async, "220") => (RuleGroup::Stable, rules::flake8_async::rules::CreateSubprocessInAsyncFunction),
(Flake8Async, "221") => (RuleGroup::Stable, rules::flake8_async::rules::RunProcessInAsyncFunction),
(Flake8Async, "222") => (RuleGroup::Stable, rules::flake8_async::rules::WaitForProcessInAsyncFunction),
(Flake8Async, "230") => (RuleGroup::Stable, rules::flake8_async::rules::BlockingOpenCallInAsyncFunction),
(Flake8Async, "250") => (RuleGroup::Preview, rules::flake8_async::rules::BlockingInputInAsyncFunction),
(Flake8Async, "251") => (RuleGroup::Stable, rules::flake8_async::rules::BlockingSleepInAsyncFunction),
// flake8-builtins

View File

@@ -58,3 +58,13 @@ pub fn relativize_path<P: AsRef<Path>>(path: P) -> String {
}
format!("{}", path.display())
}
/// Convert an absolute path to be relative to the specified project root.
pub fn relativize_path_to<P: AsRef<Path>, R: AsRef<Path>>(path: P, project_root: R) -> String {
format!(
"{}",
pathdiff::diff_paths(&path, project_root)
.expect("Could not diff paths")
.display()
)
}

View File

@@ -1231,10 +1231,6 @@ mod tests {
)]
#[test_case(Rule::AwaitOutsideAsync, Path::new("await_outside_async_function.py"))]
#[test_case(Rule::AwaitOutsideAsync, Path::new("async_comprehension.py"))]
#[test_case(
Rule::YieldFromInAsyncFunction,
Path::new("yield_from_in_async_function.py")
)]
fn test_syntax_errors(rule: Rule, path: &Path) -> Result<()> {
let snapshot = path.to_string_lossy().to_string();
let path = Path::new("resources/test/fixtures/syntax_errors").join(path);

View File

@@ -0,0 +1,174 @@
use std::collections::HashSet;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use std::io::Write;
use serde::ser::SerializeSeq;
use serde::{Serialize, Serializer};
use serde_json::json;
use ruff_db::diagnostic::Diagnostic;
use crate::fs::{relativize_path, relativize_path_to};
use crate::message::{Emitter, EmitterContext};
/// Generate JSON with violations in GitLab CI format
// https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool
pub struct GitlabEmitter {
project_dir: Option<String>,
}
impl Default for GitlabEmitter {
fn default() -> Self {
Self {
project_dir: std::env::var("CI_PROJECT_DIR").ok(),
}
}
}
impl Emitter for GitlabEmitter {
fn emit(
&mut self,
writer: &mut dyn Write,
diagnostics: &[Diagnostic],
context: &EmitterContext,
) -> anyhow::Result<()> {
serde_json::to_writer_pretty(
writer,
&SerializedMessages {
diagnostics,
context,
project_dir: self.project_dir.as_deref(),
},
)?;
Ok(())
}
}
struct SerializedMessages<'a> {
diagnostics: &'a [Diagnostic],
context: &'a EmitterContext<'a>,
project_dir: Option<&'a str>,
}
impl Serialize for SerializedMessages<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let mut s = serializer.serialize_seq(Some(self.diagnostics.len()))?;
let mut fingerprints = HashSet::<u64>::with_capacity(self.diagnostics.len());
for diagnostic in self.diagnostics {
let filename = diagnostic.expect_ruff_filename();
let (start_location, end_location) = if self.context.is_notebook(&filename) {
// We can't give a reasonable location for the structured formats,
// so we show one that's clearly a fallback
Default::default()
} else {
(
diagnostic.expect_ruff_start_location(),
diagnostic.expect_ruff_end_location(),
)
};
let path = self.project_dir.as_ref().map_or_else(
|| relativize_path(&filename),
|project_dir| relativize_path_to(&filename, project_dir),
);
let mut message_fingerprint = fingerprint(diagnostic, &path, 0);
// Make sure that we do not get a fingerprint that is already in use
// by adding in the previously generated one.
while fingerprints.contains(&message_fingerprint) {
message_fingerprint = fingerprint(diagnostic, &path, message_fingerprint);
}
fingerprints.insert(message_fingerprint);
let description = diagnostic.body();
let check_name = diagnostic.secondary_code_or_id();
let value = json!({
"check_name": check_name,
// 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": {
"path": path,
"positions": {
"begin": start_location,
"end": end_location,
},
},
});
s.serialize_element(&value)?;
}
s.end()
}
}
/// Generate a unique fingerprint to identify a violation.
fn fingerprint(message: &Diagnostic, project_path: &str, salt: u64) -> u64 {
let mut hasher = DefaultHasher::new();
salt.hash(&mut hasher);
message.name().hash(&mut hasher);
project_path.hash(&mut hasher);
hasher.finish()
}
#[cfg(test)]
mod tests {
use insta::assert_snapshot;
use crate::message::GitlabEmitter;
use crate::message::tests::{
capture_emitter_output, create_diagnostics, create_syntax_error_diagnostics,
};
#[test]
fn output() {
let mut emitter = GitlabEmitter::default();
let content = capture_emitter_output(&mut emitter, &create_diagnostics());
assert_snapshot!(redact_fingerprint(&content));
}
#[test]
fn syntax_errors() {
let mut emitter = GitlabEmitter::default();
let content = capture_emitter_output(&mut emitter, &create_syntax_error_diagnostics());
assert_snapshot!(redact_fingerprint(&content));
}
// Redact the fingerprint because the default hasher isn't stable across platforms.
fn redact_fingerprint(content: &str) -> String {
static FINGERPRINT_HAY_KEY: &str = r#""fingerprint": ""#;
let mut output = String::with_capacity(content.len());
let mut last = 0;
for (start, _) in content.match_indices(FINGERPRINT_HAY_KEY) {
let fingerprint_hash_start = start + FINGERPRINT_HAY_KEY.len();
output.push_str(&content[last..fingerprint_hash_start]);
output.push_str("<redacted>");
last = fingerprint_hash_start
+ content[fingerprint_hash_start..]
.find('"')
.expect("Expected terminating quote");
}
output.push_str(&content[last..]);
output
}
}

View File

@@ -10,6 +10,7 @@ use ruff_db::diagnostic::{
use ruff_db::files::File;
pub use github::GithubEmitter;
pub use gitlab::GitlabEmitter;
pub use grouped::GroupedEmitter;
use ruff_notebook::NotebookIndex;
use ruff_source_file::SourceFile;
@@ -21,6 +22,7 @@ use crate::Fix;
use crate::registry::Rule;
mod github;
mod gitlab;
mod grouped;
mod sarif;
mod text;

View File

@@ -1,63 +1,63 @@
---
source: crates/ruff_db/src/diagnostic/render/gitlab.rs
expression: env.render_diagnostics(&diagnostics)
source: crates/ruff_linter/src/message/gitlab.rs
expression: redact_fingerprint(&content)
---
[
{
"check_name": "F401",
"description": "F401: `os` imported but unused",
"severity": "major",
"fingerprint": "<redacted>",
"location": {
"path": "fib.py",
"positions": {
"begin": {
"line": 1,
"column": 8
"column": 8,
"line": 1
},
"end": {
"line": 1,
"column": 10
"column": 10,
"line": 1
}
}
}
},
"severity": "major"
},
{
"check_name": "F841",
"description": "F841: Local variable `x` is assigned to but never used",
"severity": "major",
"fingerprint": "<redacted>",
"location": {
"path": "fib.py",
"positions": {
"begin": {
"line": 6,
"column": 5
"column": 5,
"line": 6
},
"end": {
"line": 6,
"column": 6
"column": 6,
"line": 6
}
}
}
},
"severity": "major"
},
{
"check_name": "F821",
"description": "F821: Undefined name `a`",
"severity": "major",
"fingerprint": "<redacted>",
"location": {
"path": "undef.py",
"positions": {
"begin": {
"line": 1,
"column": 4
"column": 4,
"line": 1
},
"end": {
"line": 1,
"column": 5
"column": 5,
"line": 1
}
}
}
},
"severity": "major"
}
]

View File

@@ -1,44 +1,44 @@
---
source: crates/ruff_db/src/diagnostic/render/gitlab.rs
expression: env.render_diagnostics(&diagnostics)
source: crates/ruff_linter/src/message/gitlab.rs
expression: redact_fingerprint(&content)
---
[
{
"check_name": "invalid-syntax",
"description": "invalid-syntax: Expected one or more symbol names after import",
"severity": "major",
"fingerprint": "<redacted>",
"location": {
"path": "syntax_errors.py",
"positions": {
"begin": {
"line": 1,
"column": 15
"column": 15,
"line": 1
},
"end": {
"line": 2,
"column": 1
"column": 1,
"line": 2
}
}
}
},
"severity": "major"
},
{
"check_name": "invalid-syntax",
"description": "invalid-syntax: Expected ')', found newline",
"severity": "major",
"fingerprint": "<redacted>",
"location": {
"path": "syntax_errors.py",
"positions": {
"begin": {
"line": 3,
"column": 12
"column": 12,
"line": 3
},
"end": {
"line": 4,
"column": 1
"column": 1,
"line": 4
}
}
}
},
"severity": "major"
}
]

View File

@@ -3,9 +3,9 @@ use std::io::Write;
use ruff_db::diagnostic::{
Diagnostic, DiagnosticFormat, DisplayDiagnosticConfig, DisplayDiagnostics,
};
use ruff_diagnostics::Applicability;
use crate::message::{Emitter, EmitterContext};
use crate::settings::types::UnsafeFixes;
pub struct TextEmitter {
config: DisplayDiagnosticConfig,
@@ -46,8 +46,10 @@ impl TextEmitter {
}
#[must_use]
pub fn with_fix_applicability(mut self, applicability: Applicability) -> Self {
self.config = self.config.fix_applicability(applicability);
pub fn with_unsafe_fixes(mut self, unsafe_fixes: UnsafeFixes) -> Self {
self.config = self
.config
.fix_applicability(unsafe_fixes.required_applicability());
self
}
@@ -84,13 +86,13 @@ impl Emitter for TextEmitter {
#[cfg(test)]
mod tests {
use insta::assert_snapshot;
use ruff_diagnostics::Applicability;
use crate::message::TextEmitter;
use crate::message::tests::{
capture_emitter_notebook_output, capture_emitter_output, create_diagnostics,
create_notebook_diagnostics, create_syntax_error_diagnostics,
};
use crate::settings::types::UnsafeFixes;
#[test]
fn default() {
@@ -115,7 +117,7 @@ mod tests {
let mut emitter = TextEmitter::default()
.with_show_fix_status(true)
.with_show_source(true)
.with_fix_applicability(Applicability::Unsafe);
.with_unsafe_fixes(UnsafeFixes::Enabled);
let content = capture_emitter_output(&mut emitter, &create_diagnostics());
assert_snapshot!(content);
@@ -126,7 +128,7 @@ mod tests {
let mut emitter = TextEmitter::default()
.with_show_fix_status(true)
.with_show_source(true)
.with_fix_applicability(Applicability::Unsafe);
.with_unsafe_fixes(UnsafeFixes::Enabled);
let (messages, notebook_indexes) = create_notebook_diagnostics();
let content = capture_emitter_notebook_output(&mut emitter, &messages, &notebook_indexes);

View File

@@ -40,11 +40,6 @@ pub(crate) const fn is_bad_version_info_in_non_stub_enabled(settings: &LinterSet
settings.preview.is_enabled()
}
/// <https://github.com/astral-sh/ruff/pull/19303>
pub(crate) const fn is_fix_f_string_logging_enabled(settings: &LinterSettings) -> bool {
settings.preview.is_enabled()
}
// https://github.com/astral-sh/ruff/pull/16719
pub(crate) const fn is_fix_manual_dict_comprehension_enabled(settings: &LinterSettings) -> bool {
settings.preview.is_enabled()
@@ -255,8 +250,3 @@ pub(crate) const fn is_trailing_comma_type_params_enabled(settings: &LinterSetti
pub(crate) const fn is_maxsplit_without_separator_fix_enabled(settings: &LinterSettings) -> bool {
settings.preview.is_enabled()
}
// https://github.com/astral-sh/ruff/pull/20106
pub(crate) const fn is_bidi_forbid_arabic_letter_mark_enabled(settings: &LinterSettings) -> bool {
settings.preview.is_enabled()
}

View File

@@ -354,10 +354,7 @@ impl Renamer {
))
}
// Avoid renaming builtins and other "special" bindings.
BindingKind::FutureImport
| BindingKind::Builtin
| BindingKind::Export(_)
| BindingKind::DunderClassCell => None,
BindingKind::FutureImport | BindingKind::Builtin | BindingKind::Export(_) => None,
// By default, replace the binding's name with the target name.
BindingKind::Annotation
| BindingKind::Argument

View File

@@ -37,6 +37,7 @@ pub(crate) enum Replacement {
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) enum ProviderReplacement {
None,
AutoImport {
module: &'static str,
name: &'static str,

View File

@@ -46,7 +46,7 @@ pub(crate) struct AirflowDagNoScheduleArgument;
impl Violation for AirflowDagNoScheduleArgument {
#[derive_message_formats]
fn message(&self) -> String {
"`DAG` or `@dag` should have an explicit `schedule` argument".to_string()
"DAG should have an explicit `schedule` argument".to_string()
}
}

View File

@@ -50,6 +50,9 @@ impl Violation for Airflow3MovedToProvider<'_> {
replacement,
} = self;
match replacement {
ProviderReplacement::None => {
format!("`{deprecated}` is removed in Airflow 3.0")
}
ProviderReplacement::AutoImport {
name: _,
module: _,
@@ -82,6 +85,7 @@ impl Violation for Airflow3MovedToProvider<'_> {
provider,
version,
} => Some((module, name.as_str(), provider, version)),
ProviderReplacement::None => None,
} {
Some(format!(
"Install `apache-airflow-providers-{provider}>={version}` and use `{name}` from `{module}` instead."
@@ -1016,6 +1020,7 @@ fn check_names_moved_to_provider(checker: &Checker, expr: &Expr, ranged: TextRan
provider: "postgres",
version: "1.0.0",
},
["airflow", "operators", "postgres_operator", "Mapping"] => ProviderReplacement::None,
// apache-airflow-providers-presto
["airflow", "hooks", "presto_hook", "PrestoHook"] => ProviderReplacement::AutoImport {
@@ -1204,6 +1209,16 @@ fn check_names_moved_to_provider(checker: &Checker, expr: &Expr, ranged: TextRan
ProviderReplacement::SourceModuleMovedToProvider { module, name, .. } => {
(module, name.as_str())
}
ProviderReplacement::None => {
checker.report_diagnostic(
Airflow3MovedToProvider {
deprecated: qualified_name,
replacement,
},
ranged,
);
return;
}
};
if is_guarded_by_try_except(expr, module, name, checker.semantic()) {

View File

@@ -704,7 +704,6 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
["airflow", "operators", "subdag", ..] => {
Replacement::Message("The whole `airflow.subdag` module has been removed.")
}
["airflow", "operators", "postgres_operator", "Mapping"] => Replacement::None,
["airflow", "operators", "python", "get_current_context"] => Replacement::AutoImport {
module: "airflow.sdk",
name: "get_current_context",

View File

@@ -65,6 +65,9 @@ impl Violation for Airflow3SuggestedToMoveToProvider<'_> {
replacement,
} = self;
match replacement {
ProviderReplacement::None => {
format!("`{deprecated}` is removed in Airflow 3.0")
}
ProviderReplacement::AutoImport {
name: _,
module: _,
@@ -88,6 +91,7 @@ impl Violation for Airflow3SuggestedToMoveToProvider<'_> {
fn fix_title(&self) -> Option<String> {
let Airflow3SuggestedToMoveToProvider { replacement, .. } = self;
match replacement {
ProviderReplacement::None => None,
ProviderReplacement::AutoImport {
module,
name,
@@ -211,12 +215,6 @@ fn check_names_moved_to_provider(checker: &Checker, expr: &Expr, ranged: TextRan
version: "0.0.1",
}
}
["airflow", "sensors", "bash", "BashSensor"] => ProviderReplacement::AutoImport {
module: "airflow.providers.standard.sensor.bash",
name: "BashSensor",
provider: "standard",
version: "0.0.1",
},
[
"airflow",
"sensors",
@@ -245,12 +243,6 @@ fn check_names_moved_to_provider(checker: &Checker, expr: &Expr, ranged: TextRan
provider: "standard",
version: "0.0.2",
},
["airflow", "sensors", "python", "PythonSensor"] => ProviderReplacement::AutoImport {
module: "airflow.providers.standard.sensors.python",
name: "PythonSensor",
provider: "standard",
version: "0.0.1",
},
[
"airflow",
"sensors",
@@ -315,6 +307,16 @@ fn check_names_moved_to_provider(checker: &Checker, expr: &Expr, ranged: TextRan
ProviderReplacement::SourceModuleMovedToProvider { module, name, .. } => {
(module, name.as_str())
}
ProviderReplacement::None => {
checker.report_diagnostic(
Airflow3SuggestedToMoveToProvider {
deprecated: qualified_name,
replacement: replacement.clone(),
},
ranged.range(),
);
return;
}
};
if is_guarded_by_try_except(expr, module, name, checker.semantic()) {

View File

@@ -157,9 +157,6 @@ fn check_call_arguments(checker: &Checker, qualified_name: &QualifiedName, argum
["airflow", .., "DAG" | "dag"] => {
diagnostic_for_argument(checker, arguments, "sla_miss_callback", None);
}
["airflow", "timetables", "datasets", "DatasetOrTimeSchedule"] => {
diagnostic_for_argument(checker, arguments, "datasets", Some("assets"));
}
segments => {
if is_airflow_builtin_or_provider(segments, "operators", "Operator") {
diagnostic_for_argument(checker, arguments, "sla", None);
@@ -230,19 +227,6 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
module: "airflow.sdk",
name: (*rest).to_string(),
},
[
"airflow",
"decorators",
"base",
rest @ ("DecoratedMappedOperator"
| "DecoratedOperator"
| "TaskDecorator"
| "get_unique_task_id"
| "task_decorator_factory"),
] => Replacement::SourceModuleMoved {
module: "airflow.sdk.bases.decorator",
name: (*rest).to_string(),
},
// airflow.io
["airflow", "io", "path", "ObjectStoragePath"] => Replacement::SourceModuleMoved {
@@ -261,10 +245,6 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
name: (*rest).to_string(),
}
}
["airflow", "models", "Param"] => Replacement::AutoImport {
module: "airflow.sdk.definitions.param",
name: "Param",
},
// airflow.models.baseoperator
[
@@ -280,30 +260,16 @@ fn check_name(checker: &Checker, expr: &Expr, range: TextRange) {
module: "airflow.sdk",
name: "BaseOperatorLink",
},
// airflow.model..DAG
["airflow", "models", .., "DAG"] => Replacement::SourceModuleMoved {
module: "airflow.sdk",
name: "DAG".to_string(),
},
// airflow.sensors.base
[
"airflow",
"sensors",
"base",
rest @ ("BaseSensorOperator" | "PokeReturnValue" | "poke_mode_only"),
] => Replacement::SourceModuleMoved {
module: "airflow.sdk",
name: (*rest).to_string(),
},
// airflow.timetables
["airflow", "timetables", "datasets", "DatasetOrTimeSchedule"] => Replacement::AutoImport {
module: "airflow.timetables.assets",
name: "AssetOrTimeSchedule",
},
// airflow.utils
[
"airflow",

View File

@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/airflow/mod.rs
---
AIR002 `DAG` or `@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
@@ -12,7 +12,7 @@ AIR002 `DAG` or `@dag` should have an explicit `schedule` argument
6 | DAG(dag_id="class_schedule", schedule="@hourly")
|
AIR002 `DAG` or `@dag` should have an explicit `schedule` argument
AIR002 DAG should have an explicit `schedule` argument
--> AIR002.py:13:2
|
13 | @dag()

View File

@@ -12,14 +12,16 @@ AIR301 [*] `schedule_interval` is removed in Airflow 3.0
23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
|
help: Use `schedule` instead
18 |
19 | DAG(dag_id="class_schedule", schedule="@hourly")
20 |
- DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
21 + DAG(dag_id="class_schedule_interval", schedule="@hourly")
22 |
23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
24 |
Safe fix
18 18 |
19 19 | DAG(dag_id="class_schedule", schedule="@hourly")
20 20 |
21 |-DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
21 |+DAG(dag_id="class_schedule_interval", schedule="@hourly")
22 22 |
23 23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
24 24 |
AIR301 [*] `timetable` is removed in Airflow 3.0
--> AIR301_args.py:23:31
@@ -30,14 +32,16 @@ AIR301 [*] `timetable` is removed in Airflow 3.0
| ^^^^^^^^^
|
help: Use `schedule` instead
20 |
21 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
22 |
- DAG(dag_id="class_timetable", timetable=NullTimetable())
23 + DAG(dag_id="class_timetable", schedule=NullTimetable())
24 |
25 |
26 | DAG(dag_id="class_fail_stop", fail_stop=True)
Safe fix
20 20 |
21 21 | DAG(dag_id="class_schedule_interval", schedule_interval="@hourly")
22 22 |
23 |-DAG(dag_id="class_timetable", timetable=NullTimetable())
23 |+DAG(dag_id="class_timetable", schedule=NullTimetable())
24 24 |
25 25 |
26 26 | DAG(dag_id="class_fail_stop", fail_stop=True)
AIR301 [*] `fail_stop` is removed in Airflow 3.0
--> AIR301_args.py:26:31
@@ -48,14 +52,16 @@ AIR301 [*] `fail_stop` is removed in Airflow 3.0
28 | DAG(dag_id="class_default_view", default_view="dag_default_view")
|
help: Use `fail_fast` instead
23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
24 |
25 |
- DAG(dag_id="class_fail_stop", fail_stop=True)
26 + DAG(dag_id="class_fail_stop", fail_fast=True)
27 |
28 | DAG(dag_id="class_default_view", default_view="dag_default_view")
29 |
Safe fix
23 23 | DAG(dag_id="class_timetable", timetable=NullTimetable())
24 24 |
25 25 |
26 |-DAG(dag_id="class_fail_stop", fail_stop=True)
26 |+DAG(dag_id="class_fail_stop", fail_fast=True)
27 27 |
28 28 | DAG(dag_id="class_default_view", default_view="dag_default_view")
29 29 |
AIR301 `default_view` is removed in Airflow 3.0
--> AIR301_args.py:28:34
@@ -88,14 +94,16 @@ AIR301 [*] `schedule_interval` is removed in Airflow 3.0
43 | pass
|
help: Use `schedule` instead
38 | pass
39 |
40 |
- @dag(schedule_interval="0 * * * *")
41 + @dag(schedule="0 * * * *")
42 | def decorator_schedule_interval():
43 | pass
44 |
Safe fix
38 38 | pass
39 39 |
40 40 |
41 |-@dag(schedule_interval="0 * * * *")
41 |+@dag(schedule="0 * * * *")
42 42 | def decorator_schedule_interval():
43 43 | pass
44 44 |
AIR301 [*] `timetable` is removed in Airflow 3.0
--> AIR301_args.py:46:6
@@ -106,14 +114,16 @@ AIR301 [*] `timetable` is removed in Airflow 3.0
48 | pass
|
help: Use `schedule` instead
43 | pass
44 |
45 |
- @dag(timetable=NullTimetable())
46 + @dag(schedule=NullTimetable())
47 | def decorator_timetable():
48 | pass
49 |
Safe fix
43 43 | pass
44 44 |
45 45 |
46 |-@dag(timetable=NullTimetable())
46 |+@dag(schedule=NullTimetable())
47 47 | def decorator_timetable():
48 48 | pass
49 49 |
AIR301 [*] `execution_date` is removed in Airflow 3.0
--> AIR301_args.py:54:62
@@ -126,14 +136,16 @@ AIR301 [*] `execution_date` is removed in Airflow 3.0
56 | trigger_dagrun_op2 = TriggerDagRunOperator(
|
help: Use `logical_date` instead
51 | @dag()
52 | def decorator_deprecated_operator_args():
53 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
- task_id="trigger_dagrun_op1", trigger_dag_id="test", execution_date="2024-12-04"
54 + task_id="trigger_dagrun_op1", trigger_dag_id="test", logical_date="2024-12-04"
55 | )
56 | trigger_dagrun_op2 = TriggerDagRunOperator(
57 | task_id="trigger_dagrun_op2", trigger_dag_id="test", execution_date="2024-12-04"
Safe fix
51 51 | @dag()
52 52 | def decorator_deprecated_operator_args():
53 53 | trigger_dagrun_op = trigger_dagrun.TriggerDagRunOperator(
54 |- task_id="trigger_dagrun_op1", trigger_dag_id="test", execution_date="2024-12-04"
54 |+ task_id="trigger_dagrun_op1", trigger_dag_id="test", logical_date="2024-12-04"
55 55 | )
56 56 | trigger_dagrun_op2 = TriggerDagRunOperator(
57 57 | task_id="trigger_dagrun_op2", trigger_dag_id="test", execution_date="2024-12-04"
AIR301 [*] `execution_date` is removed in Airflow 3.0
--> AIR301_args.py:57:62
@@ -145,14 +157,16 @@ AIR301 [*] `execution_date` is removed in Airflow 3.0
58 | )
|
help: Use `logical_date` instead
54 | task_id="trigger_dagrun_op1", trigger_dag_id="test", execution_date="2024-12-04"
55 | )
56 | trigger_dagrun_op2 = TriggerDagRunOperator(
- task_id="trigger_dagrun_op2", trigger_dag_id="test", execution_date="2024-12-04"
57 + task_id="trigger_dagrun_op2", trigger_dag_id="test", logical_date="2024-12-04"
58 | )
59 |
60 | branch_dt_op = datetime.BranchDateTimeOperator(
Safe fix
54 54 | task_id="trigger_dagrun_op1", trigger_dag_id="test", execution_date="2024-12-04"
55 55 | )
56 56 | trigger_dagrun_op2 = TriggerDagRunOperator(
57 |- task_id="trigger_dagrun_op2", trigger_dag_id="test", execution_date="2024-12-04"
57 |+ task_id="trigger_dagrun_op2", trigger_dag_id="test", logical_date="2024-12-04"
58 58 | )
59 59 |
60 60 | branch_dt_op = datetime.BranchDateTimeOperator(
AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
--> AIR301_args.py:61:33
@@ -164,14 +178,16 @@ AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
63 | branch_dt_op2 = BranchDateTimeOperator(
|
help: Use `use_task_logical_date` instead
58 | )
59 |
60 | branch_dt_op = datetime.BranchDateTimeOperator(
- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
61 + task_id="branch_dt_op", use_task_logical_date=True, task_concurrency=5
62 | )
63 | branch_dt_op2 = BranchDateTimeOperator(
64 | task_id="branch_dt_op2",
Safe fix
58 58 | )
59 59 |
60 60 | branch_dt_op = datetime.BranchDateTimeOperator(
61 |- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
61 |+ task_id="branch_dt_op", use_task_logical_date=True, task_concurrency=5
62 62 | )
63 63 | branch_dt_op2 = BranchDateTimeOperator(
64 64 | task_id="branch_dt_op2",
AIR301 [*] `task_concurrency` is removed in Airflow 3.0
--> AIR301_args.py:61:62
@@ -183,14 +199,16 @@ AIR301 [*] `task_concurrency` is removed in Airflow 3.0
63 | branch_dt_op2 = BranchDateTimeOperator(
|
help: Use `max_active_tis_per_dag` instead
58 | )
59 |
60 | branch_dt_op = datetime.BranchDateTimeOperator(
- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
61 + task_id="branch_dt_op", use_task_execution_day=True, max_active_tis_per_dag=5
62 | )
63 | branch_dt_op2 = BranchDateTimeOperator(
64 | task_id="branch_dt_op2",
Safe fix
58 58 | )
59 59 |
60 60 | branch_dt_op = datetime.BranchDateTimeOperator(
61 |- task_id="branch_dt_op", use_task_execution_day=True, task_concurrency=5
61 |+ task_id="branch_dt_op", use_task_execution_day=True, max_active_tis_per_dag=5
62 62 | )
63 63 | branch_dt_op2 = BranchDateTimeOperator(
64 64 | task_id="branch_dt_op2",
AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
--> AIR301_args.py:65:9
@@ -203,14 +221,16 @@ AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
67 | )
|
help: Use `use_task_logical_date` instead
62 | )
63 | branch_dt_op2 = BranchDateTimeOperator(
64 | task_id="branch_dt_op2",
- use_task_execution_day=True,
65 + use_task_logical_date=True,
66 | sla=timedelta(seconds=10),
67 | )
68 |
Safe fix
62 62 | )
63 63 | branch_dt_op2 = BranchDateTimeOperator(
64 64 | task_id="branch_dt_op2",
65 |- use_task_execution_day=True,
65 |+ use_task_logical_date=True,
66 66 | sla=timedelta(seconds=10),
67 67 | )
68 68 |
AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
--> AIR301_args.py:92:9
@@ -222,14 +242,16 @@ AIR301 [*] `use_task_execution_day` is removed in Airflow 3.0
93 | )
|
help: Use `use_task_logical_date` instead
89 | follow_task_ids_if_false=None,
90 | follow_task_ids_if_true=None,
91 | week_day=1,
- use_task_execution_day=True,
92 + use_task_logical_date=True,
93 | )
94 |
95 | trigger_dagrun_op >> trigger_dagrun_op2
Safe fix
89 89 | follow_task_ids_if_false=None,
90 90 | follow_task_ids_if_true=None,
91 91 | week_day=1,
92 |- use_task_execution_day=True,
92 |+ use_task_logical_date=True,
93 93 | )
94 94 |
95 95 | trigger_dagrun_op >> trigger_dagrun_op2
AIR301 `filename_template` is removed in Airflow 3.0
--> AIR301_args.py:102:15

View File

@@ -11,14 +11,16 @@ AIR301 [*] `iter_datasets` is removed in Airflow 3.0
26 | dataset_from_root.iter_dataset_aliases()
|
help: Use `iter_assets` instead
22 |
23 | # airflow.Dataset
24 | dataset_from_root = DatasetFromRoot()
- dataset_from_root.iter_datasets()
25 + dataset_from_root.iter_assets()
26 | dataset_from_root.iter_dataset_aliases()
27 |
28 | # airflow.datasets
Safe fix
22 22 |
23 23 | # airflow.Dataset
24 24 | dataset_from_root = DatasetFromRoot()
25 |-dataset_from_root.iter_datasets()
25 |+dataset_from_root.iter_assets()
26 26 | dataset_from_root.iter_dataset_aliases()
27 27 |
28 28 | # airflow.datasets
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
--> AIR301_class_attribute.py:26:19
@@ -31,14 +33,16 @@ AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
28 | # airflow.datasets
|
help: Use `iter_asset_aliases` instead
23 | # airflow.Dataset
24 | dataset_from_root = DatasetFromRoot()
25 | dataset_from_root.iter_datasets()
- dataset_from_root.iter_dataset_aliases()
26 + dataset_from_root.iter_asset_aliases()
27 |
28 | # airflow.datasets
29 | dataset_to_test_method_call = Dataset()
Safe fix
23 23 | # airflow.Dataset
24 24 | dataset_from_root = DatasetFromRoot()
25 25 | dataset_from_root.iter_datasets()
26 |-dataset_from_root.iter_dataset_aliases()
26 |+dataset_from_root.iter_asset_aliases()
27 27 |
28 28 | # airflow.datasets
29 29 | dataset_to_test_method_call = Dataset()
AIR301 [*] `iter_datasets` is removed in Airflow 3.0
--> AIR301_class_attribute.py:30:29
@@ -50,14 +54,16 @@ AIR301 [*] `iter_datasets` is removed in Airflow 3.0
31 | dataset_to_test_method_call.iter_dataset_aliases()
|
help: Use `iter_assets` instead
27 |
28 | # airflow.datasets
29 | dataset_to_test_method_call = Dataset()
- dataset_to_test_method_call.iter_datasets()
30 + dataset_to_test_method_call.iter_assets()
31 | dataset_to_test_method_call.iter_dataset_aliases()
32 |
33 | alias_to_test_method_call = DatasetAlias()
Safe fix
27 27 |
28 28 | # airflow.datasets
29 29 | dataset_to_test_method_call = Dataset()
30 |-dataset_to_test_method_call.iter_datasets()
30 |+dataset_to_test_method_call.iter_assets()
31 31 | dataset_to_test_method_call.iter_dataset_aliases()
32 32 |
33 33 | alias_to_test_method_call = DatasetAlias()
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
--> AIR301_class_attribute.py:31:29
@@ -70,14 +76,16 @@ AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
33 | alias_to_test_method_call = DatasetAlias()
|
help: Use `iter_asset_aliases` instead
28 | # airflow.datasets
29 | dataset_to_test_method_call = Dataset()
30 | dataset_to_test_method_call.iter_datasets()
- dataset_to_test_method_call.iter_dataset_aliases()
31 + dataset_to_test_method_call.iter_asset_aliases()
32 |
33 | alias_to_test_method_call = DatasetAlias()
34 | alias_to_test_method_call.iter_datasets()
Safe fix
28 28 | # airflow.datasets
29 29 | dataset_to_test_method_call = Dataset()
30 30 | dataset_to_test_method_call.iter_datasets()
31 |-dataset_to_test_method_call.iter_dataset_aliases()
31 |+dataset_to_test_method_call.iter_asset_aliases()
32 32 |
33 33 | alias_to_test_method_call = DatasetAlias()
34 34 | alias_to_test_method_call.iter_datasets()
AIR301 [*] `iter_datasets` is removed in Airflow 3.0
--> AIR301_class_attribute.py:34:27
@@ -88,14 +96,16 @@ AIR301 [*] `iter_datasets` is removed in Airflow 3.0
35 | alias_to_test_method_call.iter_dataset_aliases()
|
help: Use `iter_assets` instead
31 | dataset_to_test_method_call.iter_dataset_aliases()
32 |
33 | alias_to_test_method_call = DatasetAlias()
- alias_to_test_method_call.iter_datasets()
34 + alias_to_test_method_call.iter_assets()
35 | alias_to_test_method_call.iter_dataset_aliases()
36 |
37 | any_to_test_method_call = DatasetAny()
Safe fix
31 31 | dataset_to_test_method_call.iter_dataset_aliases()
32 32 |
33 33 | alias_to_test_method_call = DatasetAlias()
34 |-alias_to_test_method_call.iter_datasets()
34 |+alias_to_test_method_call.iter_assets()
35 35 | alias_to_test_method_call.iter_dataset_aliases()
36 36 |
37 37 | any_to_test_method_call = DatasetAny()
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
--> AIR301_class_attribute.py:35:27
@@ -108,14 +118,16 @@ AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
37 | any_to_test_method_call = DatasetAny()
|
help: Use `iter_asset_aliases` instead
32 |
33 | alias_to_test_method_call = DatasetAlias()
34 | alias_to_test_method_call.iter_datasets()
- alias_to_test_method_call.iter_dataset_aliases()
35 + alias_to_test_method_call.iter_asset_aliases()
36 |
37 | any_to_test_method_call = DatasetAny()
38 | any_to_test_method_call.iter_datasets()
Safe fix
32 32 |
33 33 | alias_to_test_method_call = DatasetAlias()
34 34 | alias_to_test_method_call.iter_datasets()
35 |-alias_to_test_method_call.iter_dataset_aliases()
35 |+alias_to_test_method_call.iter_asset_aliases()
36 36 |
37 37 | any_to_test_method_call = DatasetAny()
38 38 | any_to_test_method_call.iter_datasets()
AIR301 [*] `iter_datasets` is removed in Airflow 3.0
--> AIR301_class_attribute.py:38:25
@@ -126,14 +138,16 @@ AIR301 [*] `iter_datasets` is removed in Airflow 3.0
39 | any_to_test_method_call.iter_dataset_aliases()
|
help: Use `iter_assets` instead
35 | alias_to_test_method_call.iter_dataset_aliases()
36 |
37 | any_to_test_method_call = DatasetAny()
- any_to_test_method_call.iter_datasets()
38 + any_to_test_method_call.iter_assets()
39 | any_to_test_method_call.iter_dataset_aliases()
40 |
41 | # airflow.datasets.manager
Safe fix
35 35 | alias_to_test_method_call.iter_dataset_aliases()
36 36 |
37 37 | any_to_test_method_call = DatasetAny()
38 |-any_to_test_method_call.iter_datasets()
38 |+any_to_test_method_call.iter_assets()
39 39 | any_to_test_method_call.iter_dataset_aliases()
40 40 |
41 41 | # airflow.datasets.manager
AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
--> AIR301_class_attribute.py:39:25
@@ -146,14 +160,16 @@ AIR301 [*] `iter_dataset_aliases` is removed in Airflow 3.0
41 | # airflow.datasets.manager
|
help: Use `iter_asset_aliases` instead
36 |
37 | any_to_test_method_call = DatasetAny()
38 | any_to_test_method_call.iter_datasets()
- any_to_test_method_call.iter_dataset_aliases()
39 + any_to_test_method_call.iter_asset_aliases()
40 |
41 | # airflow.datasets.manager
42 | dm = DatasetManager()
Safe fix
36 36 |
37 37 | any_to_test_method_call = DatasetAny()
38 38 | any_to_test_method_call.iter_datasets()
39 |-any_to_test_method_call.iter_dataset_aliases()
39 |+any_to_test_method_call.iter_asset_aliases()
40 40 |
41 41 | # airflow.datasets.manager
42 42 | dm = DatasetManager()
AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0
--> AIR301_class_attribute.py:42:6
@@ -165,22 +181,24 @@ AIR301 [*] `airflow.datasets.manager.DatasetManager` is removed in Airflow 3.0
44 | dm.create_datasets()
|
help: Use `AssetManager` from `airflow.assets.manager` instead.
19 | from airflow.providers_manager import ProvidersManager
20 | from airflow.secrets.base_secrets import BaseSecretsBackend
21 | from airflow.secrets.local_filesystem import LocalFilesystemBackend
22 + from airflow.assets.manager import AssetManager
23 |
24 | # airflow.Dataset
25 | dataset_from_root = DatasetFromRoot()
Safe fix
19 19 | from airflow.providers_manager import ProvidersManager
20 20 | from airflow.secrets.base_secrets import BaseSecretsBackend
21 21 | from airflow.secrets.local_filesystem import LocalFilesystemBackend
22 |+from airflow.assets.manager import AssetManager
22 23 |
23 24 | # airflow.Dataset
24 25 | dataset_from_root = DatasetFromRoot()
--------------------------------------------------------------------------------
40 | any_to_test_method_call.iter_dataset_aliases()
41 |
42 | # airflow.datasets.manager
- dm = DatasetManager()
43 + dm = AssetManager()
44 | dm.register_dataset_change()
45 | dm.create_datasets()
46 | dm.notify_dataset_created()
39 40 | any_to_test_method_call.iter_dataset_aliases()
40 41 |
41 42 | # airflow.datasets.manager
42 |-dm = DatasetManager()
43 |+dm = AssetManager()
43 44 | dm.register_dataset_change()
44 45 | dm.create_datasets()
45 46 | dm.notify_dataset_created()
AIR301 [*] `register_dataset_change` is removed in Airflow 3.0
--> AIR301_class_attribute.py:43:4
@@ -193,14 +211,16 @@ AIR301 [*] `register_dataset_change` is removed in Airflow 3.0
45 | dm.notify_dataset_created()
|
help: Use `register_asset_change` instead
40 |
41 | # airflow.datasets.manager
42 | dm = DatasetManager()
- dm.register_dataset_change()
43 + dm.register_asset_change()
44 | dm.create_datasets()
45 | dm.notify_dataset_created()
46 | dm.notify_dataset_changed()
Safe fix
40 40 |
41 41 | # airflow.datasets.manager
42 42 | dm = DatasetManager()
43 |-dm.register_dataset_change()
43 |+dm.register_asset_change()
44 44 | dm.create_datasets()
45 45 | dm.notify_dataset_created()
46 46 | dm.notify_dataset_changed()
AIR301 [*] `create_datasets` is removed in Airflow 3.0
--> AIR301_class_attribute.py:44:4
@@ -213,14 +233,16 @@ AIR301 [*] `create_datasets` is removed in Airflow 3.0
46 | dm.notify_dataset_changed()
|
help: Use `create_assets` instead
41 | # airflow.datasets.manager
42 | dm = DatasetManager()
43 | dm.register_dataset_change()
- dm.create_datasets()
44 + dm.create_assets()
45 | dm.notify_dataset_created()
46 | dm.notify_dataset_changed()
47 | dm.notify_dataset_alias_created()
Safe fix
41 41 | # airflow.datasets.manager
42 42 | dm = DatasetManager()
43 43 | dm.register_dataset_change()
44 |-dm.create_datasets()
44 |+dm.create_assets()
45 45 | dm.notify_dataset_created()
46 46 | dm.notify_dataset_changed()
47 47 | dm.notify_dataset_alias_created()
AIR301 [*] `notify_dataset_created` is removed in Airflow 3.0
--> AIR301_class_attribute.py:45:4
@@ -233,14 +255,16 @@ AIR301 [*] `notify_dataset_created` is removed in Airflow 3.0
47 | dm.notify_dataset_alias_created()
|
help: Use `notify_asset_created` instead
42 | dm = DatasetManager()
43 | dm.register_dataset_change()
44 | dm.create_datasets()
- dm.notify_dataset_created()
45 + dm.notify_asset_created()
46 | dm.notify_dataset_changed()
47 | dm.notify_dataset_alias_created()
48 |
Safe fix
42 42 | dm = DatasetManager()
43 43 | dm.register_dataset_change()
44 44 | dm.create_datasets()
45 |-dm.notify_dataset_created()
45 |+dm.notify_asset_created()
46 46 | dm.notify_dataset_changed()
47 47 | dm.notify_dataset_alias_created()
48 48 |
AIR301 [*] `notify_dataset_changed` is removed in Airflow 3.0
--> AIR301_class_attribute.py:46:4
@@ -252,14 +276,16 @@ AIR301 [*] `notify_dataset_changed` is removed in Airflow 3.0
47 | dm.notify_dataset_alias_created()
|
help: Use `notify_asset_changed` instead
43 | dm.register_dataset_change()
44 | dm.create_datasets()
45 | dm.notify_dataset_created()
- dm.notify_dataset_changed()
46 + dm.notify_asset_changed()
47 | dm.notify_dataset_alias_created()
48 |
49 | # airflow.lineage.hook
Safe fix
43 43 | dm.register_dataset_change()
44 44 | dm.create_datasets()
45 45 | dm.notify_dataset_created()
46 |-dm.notify_dataset_changed()
46 |+dm.notify_asset_changed()
47 47 | dm.notify_dataset_alias_created()
48 48 |
49 49 | # airflow.lineage.hook
AIR301 [*] `notify_dataset_alias_created` is removed in Airflow 3.0
--> AIR301_class_attribute.py:47:4
@@ -272,14 +298,16 @@ AIR301 [*] `notify_dataset_alias_created` is removed in Airflow 3.0
49 | # airflow.lineage.hook
|
help: Use `notify_asset_alias_created` instead
44 | dm.create_datasets()
45 | dm.notify_dataset_created()
46 | dm.notify_dataset_changed()
- dm.notify_dataset_alias_created()
47 + dm.notify_asset_alias_created()
48 |
49 | # airflow.lineage.hook
50 | dl_info = DatasetLineageInfo()
Safe fix
44 44 | dm.create_datasets()
45 45 | dm.notify_dataset_created()
46 46 | dm.notify_dataset_changed()
47 |-dm.notify_dataset_alias_created()
47 |+dm.notify_asset_alias_created()
48 48 |
49 49 | # airflow.lineage.hook
50 50 | dl_info = DatasetLineageInfo()
AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
--> AIR301_class_attribute.py:50:11
@@ -290,23 +318,25 @@ AIR301 [*] `airflow.lineage.hook.DatasetLineageInfo` is removed in Airflow 3.0
51 | dl_info.dataset
|
help: Use `AssetLineageInfo` from `airflow.lineage.hook` instead.
9 | DatasetAny,
10 | )
11 | from airflow.datasets.manager import DatasetManager
- from airflow.lineage.hook import DatasetLineageInfo, HookLineageCollector
12 + from airflow.lineage.hook import DatasetLineageInfo, HookLineageCollector, AssetLineageInfo
13 | from airflow.providers.amazon.aws.auth_manager.aws_auth_manager import AwsAuthManager
14 | from airflow.providers.apache.beam.hooks import BeamHook, NotAir302HookError
15 | from airflow.providers.google.cloud.secrets.secret_manager import (
Safe fix
9 9 | DatasetAny,
10 10 | )
11 11 | from airflow.datasets.manager import DatasetManager
12 |-from airflow.lineage.hook import DatasetLineageInfo, HookLineageCollector
12 |+from airflow.lineage.hook import DatasetLineageInfo, HookLineageCollector, AssetLineageInfo
13 13 | from airflow.providers.amazon.aws.auth_manager.aws_auth_manager import AwsAuthManager
14 14 | from airflow.providers.apache.beam.hooks import BeamHook, NotAir302HookError
15 15 | from airflow.providers.google.cloud.secrets.secret_manager import (
--------------------------------------------------------------------------------
47 | dm.notify_dataset_alias_created()
48 |
49 | # airflow.lineage.hook
- dl_info = DatasetLineageInfo()
50 + dl_info = AssetLineageInfo()
51 | dl_info.dataset
52 |
53 | hlc = HookLineageCollector()
47 47 | dm.notify_dataset_alias_created()
48 48 |
49 49 | # airflow.lineage.hook
50 |-dl_info = DatasetLineageInfo()
50 |+dl_info = AssetLineageInfo()
51 51 | dl_info.dataset
52 52 |
53 53 | hlc = HookLineageCollector()
AIR301 [*] `dataset` is removed in Airflow 3.0
--> AIR301_class_attribute.py:51:9
@@ -319,14 +349,16 @@ AIR301 [*] `dataset` is removed in Airflow 3.0
53 | hlc = HookLineageCollector()
|
help: Use `asset` instead
48 |
49 | # airflow.lineage.hook
50 | dl_info = DatasetLineageInfo()
- dl_info.dataset
51 + dl_info.asset
52 |
53 | hlc = HookLineageCollector()
54 | hlc.create_dataset()
Safe fix
48 48 |
49 49 | # airflow.lineage.hook
50 50 | dl_info = DatasetLineageInfo()
51 |-dl_info.dataset
51 |+dl_info.asset
52 52 |
53 53 | hlc = HookLineageCollector()
54 54 | hlc.create_dataset()
AIR301 [*] `create_dataset` is removed in Airflow 3.0
--> AIR301_class_attribute.py:54:5
@@ -338,14 +370,16 @@ AIR301 [*] `create_dataset` is removed in Airflow 3.0
56 | hlc.add_output_dataset()
|
help: Use `create_asset` instead
51 | dl_info.dataset
52 |
53 | hlc = HookLineageCollector()
- hlc.create_dataset()
54 + hlc.create_asset()
55 | hlc.add_input_dataset()
56 | hlc.add_output_dataset()
57 | hlc.collected_datasets()
Safe fix
51 51 | dl_info.dataset
52 52 |
53 53 | hlc = HookLineageCollector()
54 |-hlc.create_dataset()
54 |+hlc.create_asset()
55 55 | hlc.add_input_dataset()
56 56 | hlc.add_output_dataset()
57 57 | hlc.collected_datasets()
AIR301 [*] `add_input_dataset` is removed in Airflow 3.0
--> AIR301_class_attribute.py:55:5
@@ -358,14 +392,16 @@ AIR301 [*] `add_input_dataset` is removed in Airflow 3.0
57 | hlc.collected_datasets()
|
help: Use `add_input_asset` instead
52 |
53 | hlc = HookLineageCollector()
54 | hlc.create_dataset()
- hlc.add_input_dataset()
55 + hlc.add_input_asset()
56 | hlc.add_output_dataset()
57 | hlc.collected_datasets()
58 |
Safe fix
52 52 |
53 53 | hlc = HookLineageCollector()
54 54 | hlc.create_dataset()
55 |-hlc.add_input_dataset()
55 |+hlc.add_input_asset()
56 56 | hlc.add_output_dataset()
57 57 | hlc.collected_datasets()
58 58 |
AIR301 [*] `add_output_dataset` is removed in Airflow 3.0
--> AIR301_class_attribute.py:56:5
@@ -377,14 +413,16 @@ AIR301 [*] `add_output_dataset` is removed in Airflow 3.0
57 | hlc.collected_datasets()
|
help: Use `add_output_asset` instead
53 | hlc = HookLineageCollector()
54 | hlc.create_dataset()
55 | hlc.add_input_dataset()
- hlc.add_output_dataset()
56 + hlc.add_output_asset()
57 | hlc.collected_datasets()
58 |
59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
Safe fix
53 53 | hlc = HookLineageCollector()
54 54 | hlc.create_dataset()
55 55 | hlc.add_input_dataset()
56 |-hlc.add_output_dataset()
56 |+hlc.add_output_asset()
57 57 | hlc.collected_datasets()
58 58 |
59 59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
AIR301 [*] `collected_datasets` is removed in Airflow 3.0
--> AIR301_class_attribute.py:57:5
@@ -397,14 +435,16 @@ AIR301 [*] `collected_datasets` is removed in Airflow 3.0
59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
|
help: Use `collected_assets` instead
54 | hlc.create_dataset()
55 | hlc.add_input_dataset()
56 | hlc.add_output_dataset()
- hlc.collected_datasets()
57 + hlc.collected_assets()
58 |
59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
60 | aam = AwsAuthManager()
Safe fix
54 54 | hlc.create_dataset()
55 55 | hlc.add_input_dataset()
56 56 | hlc.add_output_dataset()
57 |-hlc.collected_datasets()
57 |+hlc.collected_assets()
58 58 |
59 59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
60 60 | aam = AwsAuthManager()
AIR301 [*] `is_authorized_dataset` is removed in Airflow 3.0
--> AIR301_class_attribute.py:61:5
@@ -417,14 +457,16 @@ AIR301 [*] `is_authorized_dataset` is removed in Airflow 3.0
63 | # airflow.providers.apache.beam.hooks
|
help: Use `is_authorized_asset` instead
58 |
59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
60 | aam = AwsAuthManager()
- aam.is_authorized_dataset()
61 + aam.is_authorized_asset()
62 |
63 | # airflow.providers.apache.beam.hooks
64 | # check get_conn_uri is caught if the class inherits from an airflow hook
Safe fix
58 58 |
59 59 | # airflow.providers.amazon.auth_manager.aws_auth_manager
60 60 | aam = AwsAuthManager()
61 |-aam.is_authorized_dataset()
61 |+aam.is_authorized_asset()
62 62 |
63 63 | # airflow.providers.apache.beam.hooks
64 64 | # check get_conn_uri is caught if the class inherits from an airflow hook
AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
--> AIR301_class_attribute.py:73:13
@@ -436,14 +478,16 @@ AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
74 | csm_backend.get_connections()
|
help: Use `get_conn_value` instead
70 |
71 | # airflow.providers.google.cloud.secrets.secret_manager
72 | csm_backend = CloudSecretManagerBackend()
- csm_backend.get_conn_uri()
73 + csm_backend.get_conn_value()
74 | csm_backend.get_connections()
75 |
76 | # airflow.providers.hashicorp.secrets.vault
Safe fix
70 70 |
71 71 | # airflow.providers.google.cloud.secrets.secret_manager
72 72 | csm_backend = CloudSecretManagerBackend()
73 |-csm_backend.get_conn_uri()
73 |+csm_backend.get_conn_value()
74 74 | csm_backend.get_connections()
75 75 |
76 76 | # airflow.providers.hashicorp.secrets.vault
AIR301 [*] `get_connections` is removed in Airflow 3.0
--> AIR301_class_attribute.py:74:13
@@ -456,14 +500,16 @@ AIR301 [*] `get_connections` is removed in Airflow 3.0
76 | # airflow.providers.hashicorp.secrets.vault
|
help: Use `get_connection` instead
71 | # airflow.providers.google.cloud.secrets.secret_manager
72 | csm_backend = CloudSecretManagerBackend()
73 | csm_backend.get_conn_uri()
- csm_backend.get_connections()
74 + csm_backend.get_connection()
75 |
76 | # airflow.providers.hashicorp.secrets.vault
77 | vault_backend = VaultBackend()
Safe fix
71 71 | # airflow.providers.google.cloud.secrets.secret_manager
72 72 | csm_backend = CloudSecretManagerBackend()
73 73 | csm_backend.get_conn_uri()
74 |-csm_backend.get_connections()
74 |+csm_backend.get_connection()
75 75 |
76 76 | # airflow.providers.hashicorp.secrets.vault
77 77 | vault_backend = VaultBackend()
AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
--> AIR301_class_attribute.py:78:15
@@ -475,14 +521,16 @@ AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
79 | vault_backend.get_connections()
|
help: Use `get_conn_value` instead
75 |
76 | # airflow.providers.hashicorp.secrets.vault
77 | vault_backend = VaultBackend()
- vault_backend.get_conn_uri()
78 + vault_backend.get_conn_value()
79 | vault_backend.get_connections()
80 |
81 | not_an_error = NotAir302SecretError()
Safe fix
75 75 |
76 76 | # airflow.providers.hashicorp.secrets.vault
77 77 | vault_backend = VaultBackend()
78 |-vault_backend.get_conn_uri()
78 |+vault_backend.get_conn_value()
79 79 | vault_backend.get_connections()
80 80 |
81 81 | not_an_error = NotAir302SecretError()
AIR301 [*] `get_connections` is removed in Airflow 3.0
--> AIR301_class_attribute.py:79:15
@@ -495,14 +543,16 @@ AIR301 [*] `get_connections` is removed in Airflow 3.0
81 | not_an_error = NotAir302SecretError()
|
help: Use `get_connection` instead
76 | # airflow.providers.hashicorp.secrets.vault
77 | vault_backend = VaultBackend()
78 | vault_backend.get_conn_uri()
- vault_backend.get_connections()
79 + vault_backend.get_connection()
80 |
81 | not_an_error = NotAir302SecretError()
82 | not_an_error.get_conn_uri()
Safe fix
76 76 | # airflow.providers.hashicorp.secrets.vault
77 77 | vault_backend = VaultBackend()
78 78 | vault_backend.get_conn_uri()
79 |-vault_backend.get_connections()
79 |+vault_backend.get_connection()
80 80 |
81 81 | not_an_error = NotAir302SecretError()
82 82 | not_an_error.get_conn_uri()
AIR301 [*] `initialize_providers_dataset_uri_resources` is removed in Airflow 3.0
--> AIR301_class_attribute.py:86:4
@@ -515,14 +565,16 @@ AIR301 [*] `initialize_providers_dataset_uri_resources` is removed in Airflow 3.
88 | pm.dataset_uri_handlers
|
help: Use `initialize_providers_asset_uri_resources` instead
83 |
84 | # airflow.providers_manager
85 | pm = ProvidersManager()
- pm.initialize_providers_dataset_uri_resources()
86 + pm.initialize_providers_asset_uri_resources()
87 | pm.dataset_factories
88 | pm.dataset_uri_handlers
89 | pm.dataset_to_openlineage_converters
Safe fix
83 83 |
84 84 | # airflow.providers_manager
85 85 | pm = ProvidersManager()
86 |-pm.initialize_providers_dataset_uri_resources()
86 |+pm.initialize_providers_asset_uri_resources()
87 87 | pm.dataset_factories
88 88 | pm.dataset_uri_handlers
89 89 | pm.dataset_to_openlineage_converters
AIR301 [*] `dataset_factories` is removed in Airflow 3.0
--> AIR301_class_attribute.py:87:4
@@ -535,14 +587,16 @@ AIR301 [*] `dataset_factories` is removed in Airflow 3.0
89 | pm.dataset_to_openlineage_converters
|
help: Use `asset_factories` instead
84 | # airflow.providers_manager
85 | pm = ProvidersManager()
86 | pm.initialize_providers_dataset_uri_resources()
- pm.dataset_factories
87 + pm.asset_factories
88 | pm.dataset_uri_handlers
89 | pm.dataset_to_openlineage_converters
90 |
Safe fix
84 84 | # airflow.providers_manager
85 85 | pm = ProvidersManager()
86 86 | pm.initialize_providers_dataset_uri_resources()
87 |-pm.dataset_factories
87 |+pm.asset_factories
88 88 | pm.dataset_uri_handlers
89 89 | pm.dataset_to_openlineage_converters
90 90 |
AIR301 [*] `dataset_uri_handlers` is removed in Airflow 3.0
--> AIR301_class_attribute.py:88:4
@@ -554,14 +608,16 @@ AIR301 [*] `dataset_uri_handlers` is removed in Airflow 3.0
89 | pm.dataset_to_openlineage_converters
|
help: Use `asset_uri_handlers` instead
85 | pm = ProvidersManager()
86 | pm.initialize_providers_dataset_uri_resources()
87 | pm.dataset_factories
- pm.dataset_uri_handlers
88 + pm.asset_uri_handlers
89 | pm.dataset_to_openlineage_converters
90 |
91 | # airflow.secrets.base_secrets
Safe fix
85 85 | pm = ProvidersManager()
86 86 | pm.initialize_providers_dataset_uri_resources()
87 87 | pm.dataset_factories
88 |-pm.dataset_uri_handlers
88 |+pm.asset_uri_handlers
89 89 | pm.dataset_to_openlineage_converters
90 90 |
91 91 | # airflow.secrets.base_secrets
AIR301 [*] `dataset_to_openlineage_converters` is removed in Airflow 3.0
--> AIR301_class_attribute.py:89:4
@@ -574,14 +630,16 @@ AIR301 [*] `dataset_to_openlineage_converters` is removed in Airflow 3.0
91 | # airflow.secrets.base_secrets
|
help: Use `asset_to_openlineage_converters` instead
86 | pm.initialize_providers_dataset_uri_resources()
87 | pm.dataset_factories
88 | pm.dataset_uri_handlers
- pm.dataset_to_openlineage_converters
89 + pm.asset_to_openlineage_converters
90 |
91 | # airflow.secrets.base_secrets
92 | base_secret_backend = BaseSecretsBackend()
Safe fix
86 86 | pm.initialize_providers_dataset_uri_resources()
87 87 | pm.dataset_factories
88 88 | pm.dataset_uri_handlers
89 |-pm.dataset_to_openlineage_converters
89 |+pm.asset_to_openlineage_converters
90 90 |
91 91 | # airflow.secrets.base_secrets
92 92 | base_secret_backend = BaseSecretsBackend()
AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
--> AIR301_class_attribute.py:93:21
@@ -593,14 +651,16 @@ AIR301 [*] `get_conn_uri` is removed in Airflow 3.0
94 | base_secret_backend.get_connections()
|
help: Use `get_conn_value` instead
90 |
91 | # airflow.secrets.base_secrets
92 | base_secret_backend = BaseSecretsBackend()
- base_secret_backend.get_conn_uri()
93 + base_secret_backend.get_conn_value()
94 | base_secret_backend.get_connections()
95 |
96 | # airflow.secrets.local_filesystem
Safe fix
90 90 |
91 91 | # airflow.secrets.base_secrets
92 92 | base_secret_backend = BaseSecretsBackend()
93 |-base_secret_backend.get_conn_uri()
93 |+base_secret_backend.get_conn_value()
94 94 | base_secret_backend.get_connections()
95 95 |
96 96 | # airflow.secrets.local_filesystem
AIR301 [*] `get_connections` is removed in Airflow 3.0
--> AIR301_class_attribute.py:94:21
@@ -613,14 +673,16 @@ AIR301 [*] `get_connections` is removed in Airflow 3.0
96 | # airflow.secrets.local_filesystem
|
help: Use `get_connection` instead
91 | # airflow.secrets.base_secrets
92 | base_secret_backend = BaseSecretsBackend()
93 | base_secret_backend.get_conn_uri()
- base_secret_backend.get_connections()
94 + base_secret_backend.get_connection()
95 |
96 | # airflow.secrets.local_filesystem
97 | lfb = LocalFilesystemBackend()
Safe fix
91 91 | # airflow.secrets.base_secrets
92 92 | base_secret_backend = BaseSecretsBackend()
93 93 | base_secret_backend.get_conn_uri()
94 |-base_secret_backend.get_connections()
94 |+base_secret_backend.get_connection()
95 95 |
96 96 | # airflow.secrets.local_filesystem
97 97 | lfb = LocalFilesystemBackend()
AIR301 [*] `get_connections` is removed in Airflow 3.0
--> AIR301_class_attribute.py:98:5
@@ -631,8 +693,10 @@ AIR301 [*] `get_connections` is removed in Airflow 3.0
| ^^^^^^^^^^^^^^^
|
help: Use `get_connection` instead
95 |
96 | # airflow.secrets.local_filesystem
97 | lfb = LocalFilesystemBackend()
- lfb.get_connections()
98 + lfb.get_connection()
Safe fix
95 95 |
96 96 | # airflow.secrets.local_filesystem
97 97 | lfb = LocalFilesystemBackend()
98 |-lfb.get_connections()
98 |+lfb.get_connection()

View File

@@ -337,14 +337,16 @@ AIR301 [*] `schedule_interval` is removed in Airflow 3.0
113 | template_searchpath=["/templates"],
|
help: Use `schedule` instead
108 |
109 | with DAG(
110 | dag_id="example_dag",
- schedule_interval="@daily",
111 + schedule="@daily",
112 | start_date=datetime(2023, 1, 1),
113 | template_searchpath=["/templates"],
114 | ) as dag:
Safe fix
108 108 |
109 109 | with DAG(
110 110 | dag_id="example_dag",
111 |- schedule_interval="@daily",
111 |+ schedule="@daily",
112 112 | start_date=datetime(2023, 1, 1),
113 113 | template_searchpath=["/templates"],
114 114 | ) as dag:
AIR301 `next_ds` is removed in Airflow 3.0
--> AIR301_context.py:135:23

View File

@@ -2,362 +2,351 @@
source: crates/ruff_linter/src/rules/airflow/mod.rs
---
AIR301 `airflow.PY36` is removed in Airflow 3.0
--> AIR301_names.py:40:1
--> AIR301_names.py:39:1
|
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
38 | # airflow root
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^
41 |
42 | # airflow.api_connexion.security
40 |
41 | # airflow.api_connexion.security
|
help: Use `sys.version_info` instead
AIR301 `airflow.PY37` is removed in Airflow 3.0
--> AIR301_names.py:40:7
--> AIR301_names.py:39:7
|
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
38 | # airflow root
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^
41 |
42 | # airflow.api_connexion.security
40 |
41 | # airflow.api_connexion.security
|
help: Use `sys.version_info` instead
AIR301 `airflow.PY38` is removed in Airflow 3.0
--> AIR301_names.py:40:13
--> AIR301_names.py:39:13
|
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
38 | # airflow root
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^
41 |
42 | # airflow.api_connexion.security
40 |
41 | # airflow.api_connexion.security
|
help: Use `sys.version_info` instead
AIR301 `airflow.PY39` is removed in Airflow 3.0
--> AIR301_names.py:40:19
--> AIR301_names.py:39:19
|
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
38 | # airflow root
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^
41 |
42 | # airflow.api_connexion.security
40 |
41 | # airflow.api_connexion.security
|
help: Use `sys.version_info` instead
AIR301 `airflow.PY310` is removed in Airflow 3.0
--> AIR301_names.py:40:25
--> AIR301_names.py:39:25
|
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
38 | # airflow root
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^^
41 |
42 | # airflow.api_connexion.security
40 |
41 | # airflow.api_connexion.security
|
help: Use `sys.version_info` instead
AIR301 `airflow.PY311` is removed in Airflow 3.0
--> AIR301_names.py:40:32
--> AIR301_names.py:39:32
|
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
38 | # airflow root
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^^
41 |
42 | # airflow.api_connexion.security
40 |
41 | # airflow.api_connexion.security
|
help: Use `sys.version_info` instead
AIR301 `airflow.PY312` is removed in Airflow 3.0
--> AIR301_names.py:40:39
--> AIR301_names.py:39:39
|
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
38 | # airflow root
39 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
| ^^^^^
41 |
42 | # airflow.api_connexion.security
40 |
41 | # airflow.api_connexion.security
|
help: Use `sys.version_info` instead
AIR301 `airflow.api_connexion.security.requires_access` is removed in Airflow 3.0
--> AIR301_names.py:43:1
--> AIR301_names.py:42:1
|
42 | # airflow.api_connexion.security
43 | requires_access
41 | # airflow.api_connexion.security
42 | requires_access
| ^^^^^^^^^^^^^^^
44 |
45 | # airflow.contrib.*
43 |
44 | # airflow.contrib.*
|
help: Use `airflow.api_fastapi.core_api.security.requires_access_*` instead
AIR301 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is removed in Airflow 3.0
--> AIR301_names.py:46:1
--> AIR301_names.py:45:1
|
45 | # airflow.contrib.*
46 | AWSAthenaHook()
44 | # airflow.contrib.*
45 | AWSAthenaHook()
| ^^^^^^^^^^^^^
|
help: The whole `airflow.contrib` module has been removed.
AIR301 `airflow.datasets.DatasetAliasEvent` is removed in Airflow 3.0
--> AIR301_names.py:50:1
--> AIR301_names.py:49:1
|
49 | # airflow.datasets
50 | DatasetAliasEvent()
48 | # airflow.datasets
49 | DatasetAliasEvent()
| ^^^^^^^^^^^^^^^^^
|
AIR301 `airflow.operators.subdag.SubDagOperator` is removed in Airflow 3.0
--> AIR301_names.py:54:1
--> AIR301_names.py:53:1
|
53 | # airflow.operators.subdag.*
54 | SubDagOperator()
52 | # airflow.operators.subdag.*
53 | SubDagOperator()
| ^^^^^^^^^^^^^^
55 |
56 | # airflow.operators.postgres_operator
|
help: The whole `airflow.subdag` module has been removed.
AIR301 `airflow.operators.postgres_operator.Mapping` is removed in Airflow 3.0
--> AIR301_names.py:57:1
|
56 | # airflow.operators.postgres_operator
57 | Mapping()
| ^^^^^^^
58 |
59 | # airflow.secrets
|
AIR301 [*] `airflow.secrets.cache.SecretCache` is removed in Airflow 3.0
--> AIR301_names.py:64:1
--> AIR301_names.py:61:1
|
63 | # airflow.secrets.cache
64 | SecretCache()
60 | # airflow.secrets.cache
61 | SecretCache()
| ^^^^^^^^^^^
|
help: Use `SecretCache` from `airflow.sdk` instead.
14 | from airflow.datasets import DatasetAliasEvent
15 | from airflow.operators.postgres_operator import Mapping
16 | from airflow.operators.subdag import SubDagOperator
- from airflow.secrets.cache import SecretCache
17 | from airflow.secrets.local_filesystem import LocalFilesystemBackend
18 | from airflow.triggers.external_task import TaskStateTrigger
19 | from airflow.utils import dates
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 | from airflow.utils.trigger_rule import TriggerRule
35 | from airflow.www.auth import has_access, has_access_dataset
36 | from airflow.www.utils import get_sensitive_variables_fields, should_hide_value_for_key
37 + from airflow.sdk import SecretCache
38 |
39 | # airflow root
40 | PY36, PY37, PY38, PY39, PY310, PY311, PY312
note: This is an unsafe fix and may change runtime behavior
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 `airflow.triggers.external_task.TaskStateTrigger` is removed in Airflow 3.0
--> AIR301_names.py:65:1
|
64 | # airflow.triggers.external_task
65 | TaskStateTrigger()
| ^^^^^^^^^^^^^^^^
66 |
67 | # airflow.utils.date
|
AIR301 `airflow.utils.dates.date_range` is removed in Airflow 3.0
--> AIR301_names.py:68:1
|
67 | # airflow.triggers.external_task
68 | TaskStateTrigger()
67 | # airflow.utils.date
68 | dates.date_range
| ^^^^^^^^^^^^^^^^
69 |
70 | # airflow.utils.date
69 | dates.days_ago
|
AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
--> AIR301_names.py:69:1
|
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
|
70 | # airflow.utils.date
71 | dates.date_range
| ^^^^^^^^^^^^^^^^
72 | dates.days_ago
69 | dates.days_ago
70 |
71 | date_range
| ^^^^^^^^^^
72 | days_ago
73 | infer_time_unit
|
AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
--> AIR301_names.py:72:1
|
70 | # airflow.utils.date
71 | dates.date_range
72 | dates.days_ago
| ^^^^^^^^^^^^^^
73 |
74 | 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:74:1
|
72 | dates.days_ago
73 |
74 | date_range
| ^^^^^^^^^^
75 | days_ago
76 | infer_time_unit
|
AIR301 `airflow.utils.dates.days_ago` is removed in Airflow 3.0
--> AIR301_names.py:75:1
|
74 | date_range
75 | days_ago
71 | date_range
72 | days_ago
| ^^^^^^^^
76 | infer_time_unit
77 | parse_execution_date
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:76:1
--> AIR301_names.py:73:1
|
74 | date_range
75 | days_ago
76 | infer_time_unit
71 | date_range
72 | days_ago
73 | infer_time_unit
| ^^^^^^^^^^^^^^^
77 | parse_execution_date
78 | round_time
74 | parse_execution_date
75 | round_time
|
AIR301 `airflow.utils.dates.parse_execution_date` is removed in Airflow 3.0
--> AIR301_names.py:77:1
--> AIR301_names.py:74:1
|
75 | days_ago
76 | infer_time_unit
77 | parse_execution_date
72 | days_ago
73 | infer_time_unit
74 | parse_execution_date
| ^^^^^^^^^^^^^^^^^^^^
78 | round_time
79 | scale_time_units
75 | round_time
76 | scale_time_units
|
AIR301 `airflow.utils.dates.round_time` is removed in Airflow 3.0
--> AIR301_names.py:78:1
--> AIR301_names.py:75:1
|
76 | infer_time_unit
77 | parse_execution_date
78 | round_time
73 | infer_time_unit
74 | parse_execution_date
75 | round_time
| ^^^^^^^^^^
79 | scale_time_units
76 | scale_time_units
|
AIR301 `airflow.utils.dates.scale_time_units` is removed in Airflow 3.0
--> AIR301_names.py:79:1
--> AIR301_names.py:76:1
|
77 | parse_execution_date
78 | round_time
79 | scale_time_units
74 | parse_execution_date
75 | round_time
76 | scale_time_units
| ^^^^^^^^^^^^^^^^
80 |
81 | # This one was not deprecated.
77 |
78 | # This one was not deprecated.
|
AIR301 `airflow.utils.dag_cycle_tester.test_cycle` is removed in Airflow 3.0
--> AIR301_names.py:86:1
--> AIR301_names.py:83:1
|
85 | # airflow.utils.dag_cycle_tester
86 | test_cycle
82 | # airflow.utils.dag_cycle_tester
83 | test_cycle
| ^^^^^^^^^^
|
AIR301 `airflow.utils.db.create_session` is removed in Airflow 3.0
--> AIR301_names.py:90:1
--> AIR301_names.py:87:1
|
89 | # airflow.utils.db
90 | create_session
86 | # airflow.utils.db
87 | create_session
| ^^^^^^^^^^^^^^
91 |
92 | # airflow.utils.decorators
88 |
89 | # airflow.utils.decorators
|
AIR301 `airflow.utils.decorators.apply_defaults` is removed in Airflow 3.0
--> AIR301_names.py:93:1
--> AIR301_names.py:90:1
|
92 | # airflow.utils.decorators
93 | apply_defaults
89 | # airflow.utils.decorators
90 | apply_defaults
| ^^^^^^^^^^^^^^
94 |
95 | # airflow.utils.file
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:96:1
--> AIR301_names.py:93:1
|
95 | # airflow.utils.file
96 | mkdirs
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:100:1
|
99 | # airflow.utils.state
100 | SHUTDOWN
| ^^^^^^^^
101 | terminating_states
|
--> AIR301_names.py:97:1
|
96 | # airflow.utils.state
97 | SHUTDOWN
| ^^^^^^^^
98 | terminating_states
|
AIR301 `airflow.utils.state.terminating_states` is removed in Airflow 3.0
--> AIR301_names.py:101:1
--> AIR301_names.py:98:1
|
99 | # airflow.utils.state
100 | SHUTDOWN
101 | terminating_states
96 | # airflow.utils.state
97 | SHUTDOWN
98 | terminating_states
| ^^^^^^^^^^^^^^^^^^
102 |
103 | # airflow.utils.trigger_rule
99 |
100 | # airflow.utils.trigger_rule
|
AIR301 `airflow.utils.trigger_rule.TriggerRule.DUMMY` is removed in Airflow 3.0
--> AIR301_names.py:104:1
--> AIR301_names.py:101:1
|
103 | # airflow.utils.trigger_rule
104 | TriggerRule.DUMMY
100 | # airflow.utils.trigger_rule
101 | TriggerRule.DUMMY
| ^^^^^^^^^^^^^^^^^
105 | TriggerRule.NONE_FAILED_OR_SKIPPED
102 | TriggerRule.NONE_FAILED_OR_SKIPPED
|
AIR301 `airflow.utils.trigger_rule.TriggerRule.NONE_FAILED_OR_SKIPPED` is removed in Airflow 3.0
--> AIR301_names.py:105:1
--> AIR301_names.py:102:1
|
103 | # airflow.utils.trigger_rule
104 | TriggerRule.DUMMY
105 | TriggerRule.NONE_FAILED_OR_SKIPPED
100 | # airflow.utils.trigger_rule
101 | TriggerRule.DUMMY
102 | TriggerRule.NONE_FAILED_OR_SKIPPED
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
AIR301 `airflow.www.auth.has_access` is removed in Airflow 3.0
--> AIR301_names.py:109:1
--> AIR301_names.py:106:1
|
108 | # airflow.www.auth
109 | has_access
105 | # airflow.www.auth
106 | has_access
| ^^^^^^^^^^
110 | has_access_dataset
107 | has_access_dataset
|
AIR301 `airflow.www.auth.has_access_dataset` is removed in Airflow 3.0
--> AIR301_names.py:110:1
--> AIR301_names.py:107:1
|
108 | # airflow.www.auth
109 | has_access
110 | has_access_dataset
105 | # airflow.www.auth
106 | has_access
107 | has_access_dataset
| ^^^^^^^^^^^^^^^^^^
111 |
112 | # airflow.www.utils
108 |
109 | # airflow.www.utils
|
AIR301 `airflow.www.utils.get_sensitive_variables_fields` is removed in Airflow 3.0
--> AIR301_names.py:113:1
--> AIR301_names.py:110:1
|
112 | # airflow.www.utils
113 | get_sensitive_variables_fields
109 | # airflow.www.utils
110 | get_sensitive_variables_fields
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114 | should_hide_value_for_key
111 | should_hide_value_for_key
|
AIR301 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0
--> AIR301_names.py:114:1
--> AIR301_names.py:111:1
|
112 | # airflow.www.utils
113 | get_sensitive_variables_fields
114 | should_hide_value_for_key
109 | # airflow.www.utils
110 | get_sensitive_variables_fields
111 | should_hide_value_for_key
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|

View File

@@ -12,14 +12,16 @@ AIR301 [*] `airflow.providers.amazon.aws.auth_manager.avp.entities.AvpEntities.D
13 | # airflow.providers.openlineage.utils.utils
|
help: Use `AvpEntities.ASSET` from `airflow.providers.amazon.aws.auth_manager.avp.entities` instead.
8 | from airflow.secrets.local_filesystem import load_connections
9 | from airflow.security.permissions import RESOURCE_DATASET
10 |
- AvpEntities.DATASET
11 + AvpEntities
12 |
13 | # airflow.providers.openlineage.utils.utils
14 | DatasetInfo()
Safe fix
8 8 | from airflow.secrets.local_filesystem import load_connections
9 9 | from airflow.security.permissions import RESOURCE_DATASET
10 10 |
11 |-AvpEntities.DATASET
11 |+AvpEntities
12 12 |
13 13 | # airflow.providers.openlineage.utils.utils
14 14 | DatasetInfo()
AIR301 [*] `airflow.providers.openlineage.utils.utils.DatasetInfo` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:14:1
@@ -30,22 +32,24 @@ AIR301 [*] `airflow.providers.openlineage.utils.utils.DatasetInfo` is removed in
15 | translate_airflow_dataset()
|
help: Use `AssetInfo` from `airflow.providers.openlineage.utils.utils` instead.
4 | from airflow.providers.openlineage.utils.utils import (
5 | DatasetInfo,
6 | translate_airflow_dataset,
7 + AssetInfo,
8 | )
9 | from airflow.secrets.local_filesystem import load_connections
10 | from airflow.security.permissions import RESOURCE_DATASET
Safe fix
4 4 | from airflow.providers.openlineage.utils.utils import (
5 5 | DatasetInfo,
6 6 | translate_airflow_dataset,
7 |+AssetInfo,
7 8 | )
8 9 | from airflow.secrets.local_filesystem import load_connections
9 10 | from airflow.security.permissions import RESOURCE_DATASET
--------------------------------------------------------------------------------
12 | AvpEntities.DATASET
13 |
14 | # airflow.providers.openlineage.utils.utils
- DatasetInfo()
15 + AssetInfo()
16 | translate_airflow_dataset()
17 |
18 | # airflow.secrets.local_filesystem
11 12 | AvpEntities.DATASET
12 13 |
13 14 | # airflow.providers.openlineage.utils.utils
14 |-DatasetInfo()
15 |+AssetInfo()
15 16 | translate_airflow_dataset()
16 17 |
17 18 | # airflow.secrets.local_filesystem
AIR301 [*] `airflow.providers.openlineage.utils.utils.translate_airflow_dataset` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:15:1
@@ -58,22 +62,24 @@ AIR301 [*] `airflow.providers.openlineage.utils.utils.translate_airflow_dataset`
17 | # airflow.secrets.local_filesystem
|
help: Use `translate_airflow_asset` from `airflow.providers.openlineage.utils.utils` instead.
4 | from airflow.providers.openlineage.utils.utils import (
5 | DatasetInfo,
6 | translate_airflow_dataset,
7 + translate_airflow_asset,
8 | )
9 | from airflow.secrets.local_filesystem import load_connections
10 | from airflow.security.permissions import RESOURCE_DATASET
Safe fix
4 4 | from airflow.providers.openlineage.utils.utils import (
5 5 | DatasetInfo,
6 6 | translate_airflow_dataset,
7 |+translate_airflow_asset,
7 8 | )
8 9 | from airflow.secrets.local_filesystem import load_connections
9 10 | from airflow.security.permissions import RESOURCE_DATASET
--------------------------------------------------------------------------------
13 |
14 | # airflow.providers.openlineage.utils.utils
15 | DatasetInfo()
- translate_airflow_dataset()
16 + translate_airflow_asset()
17 |
18 | # airflow.secrets.local_filesystem
19 | load_connections()
12 13 |
13 14 | # airflow.providers.openlineage.utils.utils
14 15 | DatasetInfo()
15 |-translate_airflow_dataset()
16 |+translate_airflow_asset()
16 17 |
17 18 | # airflow.secrets.local_filesystem
18 19 | load_connections()
AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:18:1
@@ -85,23 +91,25 @@ AIR301 [*] `airflow.secrets.local_filesystem.load_connections` is removed in Air
20 | # airflow.security.permissions
|
help: Use `load_connections_dict` from `airflow.secrets.local_filesystem` instead.
5 | DatasetInfo,
6 | translate_airflow_dataset,
7 | )
- from airflow.secrets.local_filesystem import load_connections
8 + from airflow.secrets.local_filesystem import load_connections, load_connections_dict
9 | from airflow.security.permissions import RESOURCE_DATASET
10 |
11 | AvpEntities.DATASET
Safe fix
5 5 | DatasetInfo,
6 6 | translate_airflow_dataset,
7 7 | )
8 |-from airflow.secrets.local_filesystem import load_connections
8 |+from airflow.secrets.local_filesystem import load_connections, load_connections_dict
9 9 | from airflow.security.permissions import RESOURCE_DATASET
10 10 |
11 11 | AvpEntities.DATASET
--------------------------------------------------------------------------------
15 | translate_airflow_dataset()
16 |
17 | # airflow.secrets.local_filesystem
- load_connections()
18 + load_connections_dict()
19 |
20 | # airflow.security.permissions
21 | RESOURCE_DATASET
15 15 | translate_airflow_dataset()
16 16 |
17 17 | # airflow.secrets.local_filesystem
18 |-load_connections()
18 |+load_connections_dict()
19 19 |
20 20 | # airflow.security.permissions
21 21 | RESOURCE_DATASET
AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:21:1
@@ -113,23 +121,25 @@ AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow
23 | from airflow.providers.amazon.aws.datasets.s3 import (
|
help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead.
6 | translate_airflow_dataset,
7 | )
8 | from airflow.secrets.local_filesystem import load_connections
- from airflow.security.permissions import RESOURCE_DATASET
9 + from airflow.security.permissions import RESOURCE_DATASET, RESOURCE_ASSET
10 |
11 | AvpEntities.DATASET
12 |
Safe fix
6 6 | translate_airflow_dataset,
7 7 | )
8 8 | from airflow.secrets.local_filesystem import load_connections
9 |-from airflow.security.permissions import RESOURCE_DATASET
9 |+from airflow.security.permissions import RESOURCE_DATASET, RESOURCE_ASSET
10 10 |
11 11 | AvpEntities.DATASET
12 12 |
--------------------------------------------------------------------------------
18 | load_connections()
19 |
20 | # airflow.security.permissions
- RESOURCE_DATASET
21 + RESOURCE_ASSET
22 |
23 | from airflow.providers.amazon.aws.datasets.s3 import (
24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
18 18 | load_connections()
19 19 |
20 20 | # airflow.security.permissions
21 |-RESOURCE_DATASET
21 |+RESOURCE_ASSET
22 22 |
23 23 | from airflow.providers.amazon.aws.datasets.s3 import (
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.create_dataset` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:28:1
@@ -141,16 +151,18 @@ AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.create_dataset` is removed
29 | s3_convert_dataset_to_openlineage()
|
help: Use `create_asset` from `airflow.providers.amazon.aws.assets.s3` instead.
24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
25 | )
26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
27 + from airflow.providers.amazon.aws.assets.s3 import create_asset
28 |
- s3_create_dataset()
29 + create_asset()
30 | s3_convert_dataset_to_openlineage()
31 |
32 | from airflow.providers.common.io.dataset.file import (
Safe fix
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
25 25 | )
26 26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
27 |+from airflow.providers.amazon.aws.assets.s3 import create_asset
27 28 |
28 |-s3_create_dataset()
29 |+create_asset()
29 30 | s3_convert_dataset_to_openlineage()
30 31 |
31 32 | from airflow.providers.common.io.dataset.file import (
AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:29:1
@@ -162,17 +174,19 @@ AIR301 [*] `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openline
31 | from airflow.providers.common.io.dataset.file import (
|
help: Use `convert_asset_to_openlineage` from `airflow.providers.amazon.aws.assets.s3` instead.
24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
25 | )
26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
27 + from airflow.providers.amazon.aws.assets.s3 import convert_asset_to_openlineage
28 |
29 | s3_create_dataset()
- s3_convert_dataset_to_openlineage()
30 + convert_asset_to_openlineage()
31 |
32 | from airflow.providers.common.io.dataset.file import (
33 | convert_dataset_to_openlineage as io_convert_dataset_to_openlineage,
Safe fix
24 24 | convert_dataset_to_openlineage as s3_convert_dataset_to_openlineage,
25 25 | )
26 26 | from airflow.providers.amazon.aws.datasets.s3 import create_dataset as s3_create_dataset
27 |+from airflow.providers.amazon.aws.assets.s3 import convert_asset_to_openlineage
27 28 |
28 29 | s3_create_dataset()
29 |-s3_convert_dataset_to_openlineage()
30 |+convert_asset_to_openlineage()
30 31 |
31 32 | from airflow.providers.common.io.dataset.file import (
32 33 | convert_dataset_to_openlineage as io_convert_dataset_to_openlineage,
AIR301 [*] `airflow.providers.google.datasets.bigquery.create_dataset` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:45:1
@@ -185,16 +199,18 @@ AIR301 [*] `airflow.providers.google.datasets.bigquery.create_dataset` is remove
47 | # airflow.providers.google.datasets.gcs
|
help: Use `create_asset` from `airflow.providers.google.assets.bigquery` instead.
41 | from airflow.providers.google.datasets.bigquery import (
42 | create_dataset as bigquery_create_dataset,
43 | )
44 + from airflow.providers.google.assets.bigquery import create_asset
45 |
- bigquery_create_dataset()
46 + create_asset()
47 |
48 | # airflow.providers.google.datasets.gcs
49 | from airflow.providers.google.datasets.gcs import (
Safe fix
41 41 | from airflow.providers.google.datasets.bigquery import (
42 42 | create_dataset as bigquery_create_dataset,
43 43 | )
44 |+from airflow.providers.google.assets.bigquery import create_asset
44 45 |
45 |-bigquery_create_dataset()
46 |+create_asset()
46 47 |
47 48 | # airflow.providers.google.datasets.gcs
48 49 | from airflow.providers.google.datasets.gcs import (
AIR301 [*] `airflow.providers.google.datasets.gcs.create_dataset` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:53:1
@@ -206,14 +222,16 @@ AIR301 [*] `airflow.providers.google.datasets.gcs.create_dataset` is removed in
54 | gcs_convert_dataset_to_openlineage()
|
help: Use `create_asset` from `airflow.providers.google.assets.gcs` instead.
49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
50 | )
51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
52 + from airflow.providers.google.assets.gcs import create_asset
53 |
- gcs_create_dataset()
54 + create_asset()
55 | gcs_convert_dataset_to_openlineage()
Safe fix
49 49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
50 50 | )
51 51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
52 |+from airflow.providers.google.assets.gcs import create_asset
52 53 |
53 |-gcs_create_dataset()
54 |+create_asset()
54 55 | gcs_convert_dataset_to_openlineage()
AIR301 [*] `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage` is removed in Airflow 3.0
--> AIR301_provider_names_fix.py:54:1
@@ -223,11 +241,13 @@ AIR301 [*] `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Use `convert_asset_to_openlineage` from `airflow.providers.google.assets.gcs` instead.
49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
50 | )
51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
52 + from airflow.providers.google.assets.gcs import convert_asset_to_openlineage
53 |
54 | gcs_create_dataset()
- gcs_convert_dataset_to_openlineage()
55 + convert_asset_to_openlineage()
Safe fix
49 49 | convert_dataset_to_openlineage as gcs_convert_dataset_to_openlineage,
50 50 | )
51 51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset
52 |+from airflow.providers.google.assets.gcs import convert_asset_to_openlineage
52 53 |
53 54 | gcs_create_dataset()
54 |-gcs_convert_dataset_to_openlineage()
55 |+convert_asset_to_openlineage()

View File

@@ -11,22 +11,23 @@ AIR302 [*] `airflow.hooks.S3_hook.S3Hook` is moved into `amazon` provider in Air
15 | provide_bucket_name()
|
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3Hook` from `airflow.providers.amazon.aws.hooks.s3` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.S3_hook import (
- S3Hook,
4 | provide_bucket_name,
5 | )
6 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.S3_hook import (
4 |- S3Hook,
5 4 | provide_bucket_name,
6 5 | )
7 6 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
--------------------------------------------------------------------------------
9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.hooks.s3 import S3Hook
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
10 9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.hooks.s3 import S3Hook
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.hooks.S3_hook.provide_bucket_name` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:15:1
@@ -38,22 +39,23 @@ AIR302 [*] `airflow.hooks.S3_hook.provide_bucket_name` is moved into `amazon` pr
17 | GCSToS3Operator()
|
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `provide_bucket_name` from `airflow.providers.amazon.aws.hooks.s3` instead.
2 |
3 | from airflow.hooks.S3_hook import (
4 | S3Hook,
- provide_bucket_name,
5 | )
6 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
7 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
Unsafe fix
2 2 |
3 3 | from airflow.hooks.S3_hook import (
4 4 | S3Hook,
5 |- provide_bucket_name,
6 5 | )
7 6 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
8 7 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
--------------------------------------------------------------------------------
9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.hooks.s3 import provide_bucket_name
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
10 9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.hooks.s3 import provide_bucket_name
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.operators.gcs_to_s3.GCSToS3Operator` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:17:1
@@ -66,20 +68,21 @@ AIR302 [*] `airflow.operators.gcs_to_s3.GCSToS3Operator` is moved into `amazon`
19 | RedshiftToS3Operator()
|
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `GCSToS3Operator` from `airflow.providers.amazon.aws.transfers.gcs_to_s3` instead.
4 | S3Hook,
5 | provide_bucket_name,
6 | )
- from airflow.operators.gcs_to_s3 import GCSToS3Operator
7 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
8 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.transfers.gcs_to_s3 import GCSToS3Operator
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
4 4 | S3Hook,
5 5 | provide_bucket_name,
6 6 | )
7 |-from airflow.operators.gcs_to_s3 import GCSToS3Operator
8 7 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
9 8 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.transfers.gcs_to_s3 import GCSToS3Operator
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Operator` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:18:1
@@ -91,19 +94,20 @@ AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Operator` i
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.
5 | provide_bucket_name,
6 | )
7 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
- from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
8 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.transfers.google_api_to_s3 import GoogleApiToS3Operator
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
5 5 | provide_bucket_name,
6 6 | )
7 7 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
8 |-from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
9 8 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.transfers.google_api_to_s3 import GoogleApiToS3Operator
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Operator` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:19:1
@@ -116,18 +120,19 @@ AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Operator` is m
21 | S3ToRedshiftOperator()
|
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `RedshiftToS3Operator` from `airflow.providers.amazon.aws.transfers.redshift_to_s3` instead.
6 | )
7 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
8 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
- from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.transfers.redshift_to_s3 import RedshiftToS3Operator
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
6 6 | )
7 7 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
8 8 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
9 |-from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 9 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.transfers.redshift_to_s3 import RedshiftToS3Operator
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.operators.s3_file_transform_operator.S3FileTransformOperator` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:20:1
@@ -140,17 +145,18 @@ AIR302 [*] `airflow.operators.s3_file_transform_operator.S3FileTransformOperator
22 | S3KeySensor()
|
help: Install `apache-airflow-providers-amazon>=3.0.0` and use `S3FileTransformOperator` from `airflow.providers.amazon.aws.operators.s3` instead.
7 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
8 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
9 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
- from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.operators.s3 import S3FileTransformOperator
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
7 7 | from airflow.operators.gcs_to_s3 import GCSToS3Operator
8 8 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
9 9 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 |-from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 10 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.operators.s3 import S3FileTransformOperator
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftOperator` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:21:1
@@ -162,16 +168,17 @@ AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftOperator` is m
22 | S3KeySensor()
|
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3ToRedshiftOperator` from `airflow.providers.amazon.aws.transfers.s3_to_redshift` instead.
8 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
9 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
- from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.transfers.s3_to_redshift import S3ToRedshiftOperator
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
8 8 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Operator
9 9 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 10 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 |-from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 11 | from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.transfers.s3_to_redshift import S3ToRedshiftOperator
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.sensors.s3_key_sensor.S3KeySensor` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:22:1
@@ -184,15 +191,16 @@ AIR302 [*] `airflow.sensors.s3_key_sensor.S3KeySensor` is moved into `amazon` pr
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.
9 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
- from airflow.sensors.s3_key_sensor import S3KeySensor
12 + from airflow.providers.amazon.aws.sensors.s3 import S3KeySensor
13 |
14 | S3Hook()
15 | provide_bucket_name()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
9 9 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Operator
10 10 | from airflow.operators.s3_file_transform_operator import S3FileTransformOperator
11 11 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftOperator
12 |-from airflow.sensors.s3_key_sensor import S3KeySensor
12 |+from airflow.providers.amazon.aws.sensors.s3 import S3KeySensor
13 13 |
14 14 | S3Hook()
15 15 | provide_bucket_name()
AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Transfer` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:26:1
@@ -205,14 +213,15 @@ AIR302 [*] `airflow.operators.google_api_to_s3_transfer.GoogleApiToS3Transfer` i
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.
22 | S3KeySensor()
23 |
24 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Transfer
25 + from airflow.providers.amazon.aws.transfers.google_api_to_s3 import GoogleApiToS3Operator
26 |
27 | GoogleApiToS3Transfer()
28 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
22 22 | S3KeySensor()
23 23 |
24 24 | from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Transfer
25 |+from airflow.providers.amazon.aws.transfers.google_api_to_s3 import GoogleApiToS3Operator
25 26 |
26 27 | GoogleApiToS3Transfer()
27 28 |
AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Transfer` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:30:1
@@ -225,14 +234,15 @@ AIR302 [*] `airflow.operators.redshift_to_s3_operator.RedshiftToS3Transfer` is m
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.
26 | GoogleApiToS3Transfer()
27 |
28 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Transfer
29 + from airflow.providers.amazon.aws.transfers.redshift_to_s3 import RedshiftToS3Operator
30 |
31 | RedshiftToS3Transfer()
32 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
26 26 | GoogleApiToS3Transfer()
27 27 |
28 28 | from airflow.operators.redshift_to_s3_operator import RedshiftToS3Transfer
29 |+from airflow.providers.amazon.aws.transfers.redshift_to_s3 import RedshiftToS3Operator
29 30 |
30 31 | RedshiftToS3Transfer()
31 32 |
AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftTransfer` is moved into `amazon` provider in Airflow 3.0;
--> AIR302_amazon.py:34:1
@@ -243,10 +253,11 @@ AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftTransfer` is m
| ^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3ToRedshiftOperator` from `airflow.providers.amazon.aws.transfers.s3_to_redshift` instead.
30 | RedshiftToS3Transfer()
31 |
32 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftTransfer
33 + from airflow.providers.amazon.aws.transfers.s3_to_redshift import S3ToRedshiftOperator
34 |
35 | S3ToRedshiftTransfer()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
30 30 | RedshiftToS3Transfer()
31 31 |
32 32 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftTransfer
33 |+from airflow.providers.amazon.aws.transfers.s3_to_redshift import S3ToRedshiftOperator
33 34 |
34 35 | S3ToRedshiftTransfer()

View File

@@ -12,18 +12,19 @@ AIR302 [*] `airflow.config_templates.default_celery.DEFAULT_CELERY_CONFIG` is mo
11 | app
|
help: Install `apache-airflow-providers-celery>=3.3.0` and use `DEFAULT_CELERY_CONFIG` from `airflow.providers.celery.executors.default_celery` instead.
1 | from __future__ import annotations
2 |
- from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
3 | from airflow.executors.celery_executor import (
4 | CeleryExecutor,
5 | app,
6 | )
7 + from airflow.providers.celery.executors.default_celery import DEFAULT_CELERY_CONFIG
8 |
9 | DEFAULT_CELERY_CONFIG
10 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
4 3 | from airflow.executors.celery_executor import (
5 4 | CeleryExecutor,
6 5 | app,
7 6 | )
7 |+from airflow.providers.celery.executors.default_celery import DEFAULT_CELERY_CONFIG
8 8 |
9 9 | DEFAULT_CELERY_CONFIG
10 10 |
AIR302 [*] `airflow.executors.celery_executor.app` is moved into `celery` provider in Airflow 3.0;
--> AIR302_celery.py:11:1
@@ -35,16 +36,17 @@ AIR302 [*] `airflow.executors.celery_executor.app` is moved into `celery` provid
12 | CeleryExecutor()
|
help: Install `apache-airflow-providers-celery>=3.3.0` and use `app` from `airflow.providers.celery.executors.celery_executor_utils` instead.
3 | from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
4 | from airflow.executors.celery_executor import (
5 | CeleryExecutor,
- app,
6 | )
7 + from airflow.providers.celery.executors.celery_executor_utils import app
8 |
9 | DEFAULT_CELERY_CONFIG
10 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
3 3 | from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
4 4 | from airflow.executors.celery_executor import (
5 5 | CeleryExecutor,
6 |- app,
7 6 | )
7 |+from airflow.providers.celery.executors.celery_executor_utils import app
8 8 |
9 9 | DEFAULT_CELERY_CONFIG
10 10 |
AIR302 [*] `airflow.executors.celery_executor.CeleryExecutor` is moved into `celery` provider in Airflow 3.0;
--> AIR302_celery.py:12:1
@@ -54,14 +56,15 @@ AIR302 [*] `airflow.executors.celery_executor.CeleryExecutor` is moved into `cel
| ^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-celery>=3.3.0` and use `CeleryExecutor` from `airflow.providers.celery.executors.celery_executor` instead.
2 |
3 | from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
4 | from airflow.executors.celery_executor import (
- CeleryExecutor,
5 | app,
6 | )
7 + from airflow.providers.celery.executors.celery_executor import CeleryExecutor
8 |
9 | DEFAULT_CELERY_CONFIG
10 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
4 4 | from airflow.executors.celery_executor import (
5 |- CeleryExecutor,
6 5 | app,
7 6 | )
7 |+from airflow.providers.celery.executors.celery_executor import CeleryExecutor
8 8 |
9 9 | DEFAULT_CELERY_CONFIG
10 10 |

View File

@@ -11,17 +11,18 @@ AIR302 [*] `airflow.hooks.dbapi.ConnectorProtocol` is moved into `common-sql` pr
9 | DbApiHook()
|
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `ConnectorProtocol` from `airflow.providers.common.sql.hooks.sql` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.dbapi import (
- ConnectorProtocol,
4 | DbApiHook,
5 | )
6 + from airflow.providers.common.sql.hooks.sql import ConnectorProtocol
7 |
8 | ConnectorProtocol()
9 | DbApiHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.dbapi import (
4 |- ConnectorProtocol,
5 4 | DbApiHook,
6 5 | )
6 |+from airflow.providers.common.sql.hooks.sql import ConnectorProtocol
7 7 |
8 8 | ConnectorProtocol()
9 9 | DbApiHook()
AIR302 [*] `airflow.hooks.dbapi.DbApiHook` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:9:1
@@ -33,16 +34,17 @@ AIR302 [*] `airflow.hooks.dbapi.DbApiHook` is moved into `common-sql` provider i
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.
2 |
3 | from airflow.hooks.dbapi import (
4 | ConnectorProtocol,
- DbApiHook,
5 | )
6 + from airflow.providers.common.sql.hooks.sql import DbApiHook
7 |
8 | ConnectorProtocol()
9 | DbApiHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.hooks.dbapi import (
4 4 | ConnectorProtocol,
5 |- DbApiHook,
6 5 | )
6 |+from airflow.providers.common.sql.hooks.sql import DbApiHook
7 7 |
8 8 | ConnectorProtocol()
9 9 | DbApiHook()
AIR302 [*] `airflow.hooks.dbapi_hook.DbApiHook` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:14:1
@@ -54,16 +56,17 @@ AIR302 [*] `airflow.hooks.dbapi_hook.DbApiHook` is moved into `common-sql` provi
15 | SQLCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `DbApiHook` from `airflow.providers.common.sql.hooks.sql` instead.
8 | ConnectorProtocol()
9 | DbApiHook()
10 |
- from airflow.hooks.dbapi_hook import DbApiHook
11 | from airflow.operators.check_operator import SQLCheckOperator
12 + from airflow.providers.common.sql.hooks.sql import DbApiHook
13 |
14 | DbApiHook()
15 | SQLCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
8 8 | ConnectorProtocol()
9 9 | DbApiHook()
10 10 |
11 |-from airflow.hooks.dbapi_hook import DbApiHook
12 11 | from airflow.operators.check_operator import SQLCheckOperator
12 |+from airflow.providers.common.sql.hooks.sql import DbApiHook
13 13 |
14 14 | DbApiHook()
15 15 | SQLCheckOperator()
AIR302 [*] `airflow.operators.check_operator.SQLCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:15:1
@@ -73,15 +76,16 @@ AIR302 [*] `airflow.operators.check_operator.SQLCheckOperator` is moved into `co
| ^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
9 | DbApiHook()
10 |
11 | from airflow.hooks.dbapi_hook import DbApiHook
- from airflow.operators.check_operator import SQLCheckOperator
12 + from airflow.providers.common.sql.operators.sql import SQLCheckOperator
13 |
14 | DbApiHook()
15 | SQLCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
9 9 | DbApiHook()
10 10 |
11 11 | from airflow.hooks.dbapi_hook import DbApiHook
12 |-from airflow.operators.check_operator import SQLCheckOperator
12 |+from airflow.providers.common.sql.operators.sql import SQLCheckOperator
13 13 |
14 14 | DbApiHook()
15 15 | SQLCheckOperator()
AIR302 [*] `airflow.operators.sql.SQLCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:21:1
@@ -93,15 +97,16 @@ AIR302 [*] `airflow.operators.sql.SQLCheckOperator` is moved into `common-sql` p
22 | CheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
16 |
17 |
18 | from airflow.operators.check_operator import CheckOperator
- from airflow.operators.sql import SQLCheckOperator
19 + from airflow.providers.common.sql.operators.sql import SQLCheckOperator
20 |
21 | SQLCheckOperator()
22 | CheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
16 16 |
17 17 |
18 18 | from airflow.operators.check_operator import CheckOperator
19 |-from airflow.operators.sql import SQLCheckOperator
19 |+from airflow.providers.common.sql.operators.sql import SQLCheckOperator
20 20 |
21 21 | SQLCheckOperator()
22 22 | CheckOperator()
AIR302 [*] `airflow.operators.check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:22:1
@@ -111,14 +116,15 @@ AIR302 [*] `airflow.operators.check_operator.CheckOperator` is moved into `commo
| ^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
17 |
18 | from airflow.operators.check_operator import CheckOperator
19 | from airflow.operators.sql import SQLCheckOperator
20 + from airflow.providers.common.sql.operators.sql import SQLCheckOperator
21 |
22 | SQLCheckOperator()
23 | CheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
17 17 |
18 18 | from airflow.operators.check_operator import CheckOperator
19 19 | from airflow.operators.sql import SQLCheckOperator
20 |+from airflow.providers.common.sql.operators.sql import SQLCheckOperator
20 21 |
21 22 | SQLCheckOperator()
22 23 | CheckOperator()
AIR302 [*] `airflow.operators.druid_check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:27:1
@@ -129,14 +135,15 @@ AIR302 [*] `airflow.operators.druid_check_operator.CheckOperator` is moved into
| ^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
23 |
24 |
25 | from airflow.operators.druid_check_operator import CheckOperator
26 + from airflow.providers.common.sql.operators.sql import SQLCheckOperator
27 |
28 | CheckOperator()
29 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
23 23 |
24 24 |
25 25 | from airflow.operators.druid_check_operator import CheckOperator
26 |+from airflow.providers.common.sql.operators.sql import SQLCheckOperator
26 27 |
27 28 | CheckOperator()
28 29 |
AIR302 [*] `airflow.operators.presto_check_operator.CheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:32:1
@@ -147,14 +154,15 @@ AIR302 [*] `airflow.operators.presto_check_operator.CheckOperator` is moved into
| ^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
28 |
29 |
30 | from airflow.operators.presto_check_operator import CheckOperator
31 + from airflow.providers.common.sql.operators.sql import SQLCheckOperator
32 |
33 | CheckOperator()
34 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
28 28 |
29 29 |
30 30 | from airflow.operators.presto_check_operator import CheckOperator
31 |+from airflow.providers.common.sql.operators.sql import SQLCheckOperator
31 32 |
32 33 | CheckOperator()
33 34 |
AIR302 [*] `airflow.operators.druid_check_operator.DruidCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:42:1
@@ -167,14 +175,15 @@ AIR302 [*] `airflow.operators.druid_check_operator.DruidCheckOperator` is moved
44 | IntervalCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
38 | )
39 | from airflow.operators.druid_check_operator import DruidCheckOperator
40 | from airflow.operators.presto_check_operator import PrestoCheckOperator
41 + from airflow.providers.common.sql.operators.sql import SQLCheckOperator
42 |
43 | DruidCheckOperator()
44 | PrestoCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
38 38 | )
39 39 | from airflow.operators.druid_check_operator import DruidCheckOperator
40 40 | from airflow.operators.presto_check_operator import PrestoCheckOperator
41 |+from airflow.providers.common.sql.operators.sql import SQLCheckOperator
41 42 |
42 43 | DruidCheckOperator()
43 44 | PrestoCheckOperator()
AIR302 [*] `airflow.operators.presto_check_operator.PrestoCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:43:1
@@ -186,14 +195,15 @@ AIR302 [*] `airflow.operators.presto_check_operator.PrestoCheckOperator` is move
45 | SQLIntervalCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
38 | )
39 | from airflow.operators.druid_check_operator import DruidCheckOperator
40 | from airflow.operators.presto_check_operator import PrestoCheckOperator
41 + from airflow.providers.common.sql.operators.sql import SQLCheckOperator
42 |
43 | DruidCheckOperator()
44 | PrestoCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
38 38 | )
39 39 | from airflow.operators.druid_check_operator import DruidCheckOperator
40 40 | from airflow.operators.presto_check_operator import PrestoCheckOperator
41 |+from airflow.providers.common.sql.operators.sql import SQLCheckOperator
41 42 |
42 43 | DruidCheckOperator()
43 44 | PrestoCheckOperator()
AIR302 [*] `airflow.operators.check_operator.IntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:44:1
@@ -205,18 +215,19 @@ AIR302 [*] `airflow.operators.check_operator.IntervalCheckOperator` is moved int
45 | SQLIntervalCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
34 |
35 | from airflow.operators.check_operator import (
36 | IntervalCheckOperator,
- SQLIntervalCheckOperator,
37 | )
38 | from airflow.operators.druid_check_operator import DruidCheckOperator
39 | from airflow.operators.presto_check_operator import PrestoCheckOperator
40 + from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
41 |
42 | DruidCheckOperator()
43 | PrestoCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
34 34 |
35 35 | from airflow.operators.check_operator import (
36 36 | IntervalCheckOperator,
37 |- SQLIntervalCheckOperator,
38 37 | )
39 38 | from airflow.operators.druid_check_operator import DruidCheckOperator
40 39 | from airflow.operators.presto_check_operator import PrestoCheckOperator
40 |+from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
41 41 |
42 42 | DruidCheckOperator()
43 43 | PrestoCheckOperator()
AIR302 [*] `airflow.operators.check_operator.SQLIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:45:1
@@ -227,18 +238,19 @@ AIR302 [*] `airflow.operators.check_operator.SQLIntervalCheckOperator` is moved
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
34 |
35 | from airflow.operators.check_operator import (
36 | IntervalCheckOperator,
- SQLIntervalCheckOperator,
37 | )
38 | from airflow.operators.druid_check_operator import DruidCheckOperator
39 | from airflow.operators.presto_check_operator import PrestoCheckOperator
40 + from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
41 |
42 | DruidCheckOperator()
43 | PrestoCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
34 34 |
35 35 | from airflow.operators.check_operator import (
36 36 | IntervalCheckOperator,
37 |- SQLIntervalCheckOperator,
38 37 | )
39 38 | from airflow.operators.druid_check_operator import DruidCheckOperator
40 39 | from airflow.operators.presto_check_operator import PrestoCheckOperator
40 |+from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
41 41 |
42 42 | DruidCheckOperator()
43 43 | PrestoCheckOperator()
AIR302 [*] `airflow.operators.presto_check_operator.IntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:54:1
@@ -251,14 +263,15 @@ AIR302 [*] `airflow.operators.presto_check_operator.IntervalCheckOperator` is mo
56 | PrestoIntervalCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
50 | PrestoIntervalCheckOperator,
51 | )
52 | from airflow.operators.sql import SQLIntervalCheckOperator
53 + from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
54 |
55 | IntervalCheckOperator()
56 | SQLIntervalCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
50 50 | PrestoIntervalCheckOperator,
51 51 | )
52 52 | from airflow.operators.sql import SQLIntervalCheckOperator
53 |+from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
53 54 |
54 55 | IntervalCheckOperator()
55 56 | SQLIntervalCheckOperator()
AIR302 [*] `airflow.operators.sql.SQLIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:55:1
@@ -269,15 +282,16 @@ AIR302 [*] `airflow.operators.sql.SQLIntervalCheckOperator` is moved into `commo
56 | PrestoIntervalCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
49 | IntervalCheckOperator,
50 | PrestoIntervalCheckOperator,
51 | )
- from airflow.operators.sql import SQLIntervalCheckOperator
52 + from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
53 |
54 | IntervalCheckOperator()
55 | SQLIntervalCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
49 49 | IntervalCheckOperator,
50 50 | PrestoIntervalCheckOperator,
51 51 | )
52 |-from airflow.operators.sql import SQLIntervalCheckOperator
52 |+from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
53 53 |
54 54 | IntervalCheckOperator()
55 55 | SQLIntervalCheckOperator()
AIR302 [*] `airflow.operators.presto_check_operator.PrestoIntervalCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:56:1
@@ -288,14 +302,15 @@ AIR302 [*] `airflow.operators.presto_check_operator.PrestoIntervalCheckOperator`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
50 | PrestoIntervalCheckOperator,
51 | )
52 | from airflow.operators.sql import SQLIntervalCheckOperator
53 + from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
54 |
55 | IntervalCheckOperator()
56 | SQLIntervalCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
50 50 | PrestoIntervalCheckOperator,
51 51 | )
52 52 | from airflow.operators.sql import SQLIntervalCheckOperator
53 |+from airflow.providers.common.sql.operators.sql import SQLIntervalCheckOperator
53 54 |
54 55 | IntervalCheckOperator()
55 56 | SQLIntervalCheckOperator()
AIR302 [*] `airflow.operators.check_operator.SQLThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:64:1
@@ -307,17 +322,18 @@ AIR302 [*] `airflow.operators.check_operator.SQLThresholdCheckOperator` is moved
65 | ThresholdCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
57 |
58 |
59 | from airflow.operators.check_operator import (
- SQLThresholdCheckOperator,
60 | ThresholdCheckOperator,
61 | )
62 + from airflow.providers.common.sql.operators.sql import SQLThresholdCheckOperator
63 |
64 | SQLThresholdCheckOperator()
65 | ThresholdCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
57 57 |
58 58 |
59 59 | from airflow.operators.check_operator import (
60 |- SQLThresholdCheckOperator,
61 60 | ThresholdCheckOperator,
62 61 | )
62 |+from airflow.providers.common.sql.operators.sql import SQLThresholdCheckOperator
63 63 |
64 64 | SQLThresholdCheckOperator()
65 65 | ThresholdCheckOperator()
AIR302 [*] `airflow.operators.check_operator.ThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:65:1
@@ -327,17 +343,18 @@ AIR302 [*] `airflow.operators.check_operator.ThresholdCheckOperator` is moved in
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
57 |
58 |
59 | from airflow.operators.check_operator import (
- SQLThresholdCheckOperator,
60 | ThresholdCheckOperator,
61 | )
62 + from airflow.providers.common.sql.operators.sql import SQLThresholdCheckOperator
63 |
64 | SQLThresholdCheckOperator()
65 | ThresholdCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
57 57 |
58 58 |
59 59 | from airflow.operators.check_operator import (
60 |- SQLThresholdCheckOperator,
61 60 | ThresholdCheckOperator,
62 61 | )
62 |+from airflow.providers.common.sql.operators.sql import SQLThresholdCheckOperator
63 63 |
64 64 | SQLThresholdCheckOperator()
65 65 | ThresholdCheckOperator()
AIR302 [*] `airflow.operators.sql.SQLThresholdCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:70:1
@@ -348,15 +365,16 @@ AIR302 [*] `airflow.operators.sql.SQLThresholdCheckOperator` is moved into `comm
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
65 | ThresholdCheckOperator()
66 |
67 |
- from airflow.operators.sql import SQLThresholdCheckOperator
68 + from airflow.providers.common.sql.operators.sql import SQLThresholdCheckOperator
69 |
70 | SQLThresholdCheckOperator()
71 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
65 65 | ThresholdCheckOperator()
66 66 |
67 67 |
68 |-from airflow.operators.sql import SQLThresholdCheckOperator
68 |+from airflow.providers.common.sql.operators.sql import SQLThresholdCheckOperator
69 69 |
70 70 | SQLThresholdCheckOperator()
71 71 |
AIR302 [*] `airflow.operators.check_operator.SQLValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:78:1
@@ -368,17 +386,18 @@ AIR302 [*] `airflow.operators.check_operator.SQLValueCheckOperator` is moved int
79 | ValueCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
71 |
72 |
73 | from airflow.operators.check_operator import (
- SQLValueCheckOperator,
74 | ValueCheckOperator,
75 | )
76 + from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
77 |
78 | SQLValueCheckOperator()
79 | ValueCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
71 71 |
72 72 |
73 73 | from airflow.operators.check_operator import (
74 |- SQLValueCheckOperator,
75 74 | ValueCheckOperator,
76 75 | )
76 |+from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
77 77 |
78 78 | SQLValueCheckOperator()
79 79 | ValueCheckOperator()
AIR302 [*] `airflow.operators.check_operator.ValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:79:1
@@ -388,17 +407,18 @@ AIR302 [*] `airflow.operators.check_operator.ValueCheckOperator` is moved into `
| ^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
71 |
72 |
73 | from airflow.operators.check_operator import (
- SQLValueCheckOperator,
74 | ValueCheckOperator,
75 | )
76 + from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
77 |
78 | SQLValueCheckOperator()
79 | ValueCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
71 71 |
72 72 |
73 73 | from airflow.operators.check_operator import (
74 |- SQLValueCheckOperator,
75 74 | ValueCheckOperator,
76 75 | )
76 |+from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
77 77 |
78 78 | SQLValueCheckOperator()
79 79 | ValueCheckOperator()
AIR302 [*] `airflow.operators.sql.SQLValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:88:1
@@ -411,15 +431,16 @@ AIR302 [*] `airflow.operators.sql.SQLValueCheckOperator` is moved into `common-s
90 | PrestoValueCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
83 | PrestoValueCheckOperator,
84 | ValueCheckOperator,
85 | )
- from airflow.operators.sql import SQLValueCheckOperator
86 + from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
87 |
88 | SQLValueCheckOperator()
89 | ValueCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
83 83 | PrestoValueCheckOperator,
84 84 | ValueCheckOperator,
85 85 | )
86 |-from airflow.operators.sql import SQLValueCheckOperator
86 |+from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
87 87 |
88 88 | SQLValueCheckOperator()
89 89 | ValueCheckOperator()
AIR302 [*] `airflow.operators.presto_check_operator.ValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:89:1
@@ -430,14 +451,15 @@ AIR302 [*] `airflow.operators.presto_check_operator.ValueCheckOperator` is moved
90 | PrestoValueCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
84 | ValueCheckOperator,
85 | )
86 | from airflow.operators.sql import SQLValueCheckOperator
87 + from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
88 |
89 | SQLValueCheckOperator()
90 | ValueCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
84 84 | ValueCheckOperator,
85 85 | )
86 86 | from airflow.operators.sql import SQLValueCheckOperator
87 |+from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
87 88 |
88 89 | SQLValueCheckOperator()
89 90 | ValueCheckOperator()
AIR302 [*] `airflow.operators.presto_check_operator.PrestoValueCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:90:1
@@ -448,14 +470,15 @@ AIR302 [*] `airflow.operators.presto_check_operator.PrestoValueCheckOperator` is
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
84 | ValueCheckOperator,
85 | )
86 | from airflow.operators.sql import SQLValueCheckOperator
87 + from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
88 |
89 | SQLValueCheckOperator()
90 | ValueCheckOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
84 84 | ValueCheckOperator,
85 85 | )
86 86 | from airflow.operators.sql import SQLValueCheckOperator
87 |+from airflow.providers.common.sql.operators.sql import SQLValueCheckOperator
87 88 |
88 89 | SQLValueCheckOperator()
89 90 | ValueCheckOperator()
AIR302 [*] `airflow.operators.sql.BaseSQLOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:102:1
@@ -468,21 +491,22 @@ AIR302 [*] `airflow.operators.sql.BaseSQLOperator` is moved into `common-sql` pr
104 | SQLTableCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `BaseSQLOperator` from `airflow.providers.common.sql.operators.sql` instead.
91 |
92 |
93 | from airflow.operators.sql import (
- BaseSQLOperator,
94 | BranchSQLOperator,
95 | SQLColumnCheckOperator,
96 | SQLTableCheckOperator,
97 | _convert_to_float_if_possible,
98 | parse_boolean,
99 | )
100 + from airflow.providers.common.sql.operators.sql import BaseSQLOperator
101 |
102 | BaseSQLOperator()
103 | BranchSQLOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
91 91 |
92 92 |
93 93 | from airflow.operators.sql import (
94 |- BaseSQLOperator,
95 94 | BranchSQLOperator,
96 95 | SQLColumnCheckOperator,
97 96 | SQLTableCheckOperator,
98 97 | _convert_to_float_if_possible,
99 98 | parse_boolean,
100 99 | )
100 |+from airflow.providers.common.sql.operators.sql import BaseSQLOperator
101 101 |
102 102 | BaseSQLOperator()
103 103 | BranchSQLOperator()
AIR302 [*] `airflow.operators.sql.BranchSQLOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:103:1
@@ -494,20 +518,21 @@ AIR302 [*] `airflow.operators.sql.BranchSQLOperator` is moved into `common-sql`
105 | SQLColumnCheckOperator()
|
help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `BranchSQLOperator` from `airflow.providers.common.sql.operators.sql` instead.
92 |
93 | from airflow.operators.sql import (
94 | BaseSQLOperator,
- BranchSQLOperator,
95 | SQLColumnCheckOperator,
96 | SQLTableCheckOperator,
97 | _convert_to_float_if_possible,
98 | parse_boolean,
99 | )
100 + from airflow.providers.common.sql.operators.sql import BranchSQLOperator
101 |
102 | BaseSQLOperator()
103 | BranchSQLOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
92 92 |
93 93 | from airflow.operators.sql import (
94 94 | BaseSQLOperator,
95 |- BranchSQLOperator,
96 95 | SQLColumnCheckOperator,
97 96 | SQLTableCheckOperator,
98 97 | _convert_to_float_if_possible,
99 98 | parse_boolean,
100 99 | )
100 |+from airflow.providers.common.sql.operators.sql import BranchSQLOperator
101 101 |
102 102 | BaseSQLOperator()
103 103 | BranchSQLOperator()
AIR302 [*] `airflow.operators.sql.SQLTableCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:104:1
@@ -520,18 +545,19 @@ AIR302 [*] `airflow.operators.sql.SQLTableCheckOperator` is moved into `common-s
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.
94 | BaseSQLOperator,
95 | BranchSQLOperator,
96 | SQLColumnCheckOperator,
- SQLTableCheckOperator,
97 | _convert_to_float_if_possible,
98 | parse_boolean,
99 | )
100 + from airflow.providers.common.sql.operators.sql import SQLTableCheckOperator
101 |
102 | BaseSQLOperator()
103 | BranchSQLOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
94 94 | BaseSQLOperator,
95 95 | BranchSQLOperator,
96 96 | SQLColumnCheckOperator,
97 |- SQLTableCheckOperator,
98 97 | _convert_to_float_if_possible,
99 98 | parse_boolean,
100 99 | )
100 |+from airflow.providers.common.sql.operators.sql import SQLTableCheckOperator
101 101 |
102 102 | BaseSQLOperator()
103 103 | BranchSQLOperator()
AIR302 [*] `airflow.operators.sql.SQLColumnCheckOperator` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:105:1
@@ -544,19 +570,20 @@ AIR302 [*] `airflow.operators.sql.SQLColumnCheckOperator` is moved into `common-
107 | parse_boolean()
|
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SQLColumnCheckOperator` from `airflow.providers.common.sql.operators.sql` instead.
93 | from airflow.operators.sql import (
94 | BaseSQLOperator,
95 | BranchSQLOperator,
- SQLColumnCheckOperator,
96 | SQLTableCheckOperator,
97 | _convert_to_float_if_possible,
98 | parse_boolean,
99 | )
100 + from airflow.providers.common.sql.operators.sql import SQLColumnCheckOperator
101 |
102 | BaseSQLOperator()
103 | BranchSQLOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
93 93 | from airflow.operators.sql import (
94 94 | BaseSQLOperator,
95 95 | BranchSQLOperator,
96 |- SQLColumnCheckOperator,
97 96 | SQLTableCheckOperator,
98 97 | _convert_to_float_if_possible,
99 98 | parse_boolean,
100 99 | )
100 |+from airflow.providers.common.sql.operators.sql import SQLColumnCheckOperator
101 101 |
102 102 | BaseSQLOperator()
103 103 | BranchSQLOperator()
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
@@ -568,17 +595,18 @@ AIR302 [*] `airflow.operators.sql._convert_to_float_if_possible` is moved into `
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.
95 | BranchSQLOperator,
96 | SQLColumnCheckOperator,
97 | SQLTableCheckOperator,
- _convert_to_float_if_possible,
98 | parse_boolean,
99 | )
100 + from airflow.providers.common.sql.operators.sql import _convert_to_float_if_possible
101 |
102 | BaseSQLOperator()
103 | BranchSQLOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
95 95 | BranchSQLOperator,
96 96 | SQLColumnCheckOperator,
97 97 | SQLTableCheckOperator,
98 |- _convert_to_float_if_possible,
99 98 | parse_boolean,
100 99 | )
100 |+from airflow.providers.common.sql.operators.sql import _convert_to_float_if_possible
101 101 |
102 102 | BaseSQLOperator()
103 103 | BranchSQLOperator()
AIR302 [*] `airflow.operators.sql.parse_boolean` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:107:1
@@ -589,16 +617,17 @@ AIR302 [*] `airflow.operators.sql.parse_boolean` is moved into `common-sql` prov
| ^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `parse_boolean` from `airflow.providers.common.sql.operators.sql` instead.
96 | SQLColumnCheckOperator,
97 | SQLTableCheckOperator,
98 | _convert_to_float_if_possible,
- parse_boolean,
99 | )
100 + from airflow.providers.common.sql.operators.sql import parse_boolean
101 |
102 | BaseSQLOperator()
103 | BranchSQLOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
96 96 | SQLColumnCheckOperator,
97 97 | SQLTableCheckOperator,
98 98 | _convert_to_float_if_possible,
99 |- parse_boolean,
100 99 | )
100 |+from airflow.providers.common.sql.operators.sql import parse_boolean
101 101 |
102 102 | BaseSQLOperator()
103 103 | BranchSQLOperator()
AIR302 [*] `airflow.sensors.sql.SqlSensor` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:112:1
@@ -609,15 +638,16 @@ AIR302 [*] `airflow.sensors.sql.SqlSensor` is moved into `common-sql` provider i
| ^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead.
107 | parse_boolean()
108 |
109 |
- from airflow.sensors.sql import SqlSensor
110 + from airflow.providers.common.sql.sensors.sql import SqlSensor
111 |
112 | SqlSensor()
113 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
107 107 | parse_boolean()
108 108 |
109 109 |
110 |-from airflow.sensors.sql import SqlSensor
110 |+from airflow.providers.common.sql.sensors.sql import SqlSensor
111 111 |
112 112 | SqlSensor()
113 113 |
AIR302 [*] `airflow.sensors.sql_sensor.SqlSensor` is moved into `common-sql` provider in Airflow 3.0;
--> AIR302_common_sql.py:117:1
@@ -628,12 +658,13 @@ AIR302 [*] `airflow.sensors.sql_sensor.SqlSensor` is moved into `common-sql` pro
| ^^^^^^^^^
|
help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead.
112 | SqlSensor()
113 |
114 |
- from airflow.sensors.sql_sensor import SqlSensor
115 + from airflow.providers.common.sql.sensors.sql import SqlSensor
116 |
117 | SqlSensor()
118 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
112 112 | SqlSensor()
113 113 |
114 114 |
115 |-from airflow.sensors.sql_sensor import SqlSensor
115 |+from airflow.providers.common.sql.sensors.sql import SqlSensor
116 116 |
117 117 | SqlSensor()
118 118 |

View File

@@ -10,10 +10,11 @@ AIR302 [*] `airflow.executors.dask_executor.DaskExecutor` is moved into `daskexe
| ^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-daskexecutor>=1.0.0` and use `DaskExecutor` from `airflow.providers.daskexecutor.executors.dask_executor` instead.
1 | from __future__ import annotations
2 |
- from airflow.executors.dask_executor import DaskExecutor
3 + from airflow.providers.daskexecutor.executors.dask_executor import DaskExecutor
4 |
5 | DaskExecutor()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.executors.dask_executor import DaskExecutor
3 |+from airflow.providers.daskexecutor.executors.dask_executor import DaskExecutor
4 4 |
5 5 | DaskExecutor()

View File

@@ -11,21 +11,22 @@ AIR302 [*] `airflow.hooks.druid_hook.DruidDbApiHook` is moved into `apache-druid
13 | DruidHook()
|
help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `DruidDbApiHook` from `airflow.providers.apache.druid.hooks.druid` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.druid_hook import (
- DruidDbApiHook,
4 | DruidHook,
5 | )
6 | from airflow.operators.hive_to_druid import (
7 | HiveToDruidOperator,
8 | HiveToDruidTransfer,
9 | )
10 + from airflow.providers.apache.druid.hooks.druid import DruidDbApiHook
11 |
12 | DruidDbApiHook()
13 | DruidHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.druid_hook import (
4 |- DruidDbApiHook,
5 4 | DruidHook,
6 5 | )
7 6 | from airflow.operators.hive_to_druid import (
8 7 | HiveToDruidOperator,
9 8 | HiveToDruidTransfer,
10 9 | )
10 |+from airflow.providers.apache.druid.hooks.druid import DruidDbApiHook
11 11 |
12 12 | DruidDbApiHook()
13 13 | DruidHook()
AIR302 [*] `airflow.hooks.druid_hook.DruidHook` is moved into `apache-druid` provider in Airflow 3.0;
--> AIR302_druid.py:13:1
@@ -37,20 +38,21 @@ AIR302 [*] `airflow.hooks.druid_hook.DruidHook` is moved into `apache-druid` pro
15 | HiveToDruidOperator()
|
help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `DruidHook` from `airflow.providers.apache.druid.hooks.druid` instead.
2 |
3 | from airflow.hooks.druid_hook import (
4 | DruidDbApiHook,
- DruidHook,
5 | )
6 | from airflow.operators.hive_to_druid import (
7 | HiveToDruidOperator,
8 | HiveToDruidTransfer,
9 | )
10 + from airflow.providers.apache.druid.hooks.druid import DruidHook
11 |
12 | DruidDbApiHook()
13 | DruidHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.hooks.druid_hook import (
4 4 | DruidDbApiHook,
5 |- DruidHook,
6 5 | )
7 6 | from airflow.operators.hive_to_druid import (
8 7 | HiveToDruidOperator,
9 8 | HiveToDruidTransfer,
10 9 | )
10 |+from airflow.providers.apache.druid.hooks.druid import DruidHook
11 11 |
12 12 | DruidDbApiHook()
13 13 | DruidHook()
AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidOperator` is moved into `apache-druid` provider in Airflow 3.0;
--> AIR302_druid.py:15:1
@@ -62,17 +64,18 @@ AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidOperator` is moved into `
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.
5 | DruidHook,
6 | )
7 | from airflow.operators.hive_to_druid import (
- HiveToDruidOperator,
8 | HiveToDruidTransfer,
9 | )
10 + from airflow.providers.apache.druid.transfers.hive_to_druid import HiveToDruidOperator
11 |
12 | DruidDbApiHook()
13 | DruidHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
5 5 | DruidHook,
6 6 | )
7 7 | from airflow.operators.hive_to_druid import (
8 |- HiveToDruidOperator,
9 8 | HiveToDruidTransfer,
10 9 | )
10 |+from airflow.providers.apache.druid.transfers.hive_to_druid import HiveToDruidOperator
11 11 |
12 12 | DruidDbApiHook()
13 13 | DruidHook()
AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidTransfer` is moved into `apache-druid` provider in Airflow 3.0;
--> AIR302_druid.py:16:1
@@ -82,14 +85,15 @@ AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidTransfer` is moved into `
| ^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `HiveToDruidOperator` from `airflow.providers.apache.druid.transfers.hive_to_druid` instead.
5 | DruidHook,
6 | )
7 | from airflow.operators.hive_to_druid import (
- HiveToDruidOperator,
8 | HiveToDruidTransfer,
9 | )
10 + from airflow.providers.apache.druid.transfers.hive_to_druid import HiveToDruidOperator
11 |
12 | DruidDbApiHook()
13 | DruidHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
5 5 | DruidHook,
6 6 | )
7 7 | from airflow.operators.hive_to_druid import (
8 |- HiveToDruidOperator,
9 8 | HiveToDruidTransfer,
10 9 | )
10 |+from airflow.providers.apache.druid.transfers.hive_to_druid import HiveToDruidOperator
11 11 |
12 12 | DruidDbApiHook()
13 13 | DruidHook()

View File

@@ -12,19 +12,20 @@ AIR302 [*] `airflow.api.auth.backend.basic_auth.CLIENT_AUTH` is moved into `fab`
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.
1 | from __future__ import annotations
2 |
3 | from airflow.api.auth.backend.basic_auth import (
- CLIENT_AUTH,
4 | auth_current_user,
5 | init_app,
6 | requires_authentication,
7 | )
8 + from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import CLIENT_AUTH
9 |
10 | CLIENT_AUTH
11 | init_app()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.api.auth.backend.basic_auth import (
4 |- CLIENT_AUTH,
5 4 | auth_current_user,
6 5 | init_app,
7 6 | requires_authentication,
8 7 | )
8 |+from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import CLIENT_AUTH
9 9 |
10 10 | CLIENT_AUTH
11 11 | init_app()
AIR302 [*] `airflow.api.auth.backend.basic_auth.init_app` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:11:1
@@ -36,17 +37,18 @@ AIR302 [*] `airflow.api.auth.backend.basic_auth.init_app` is moved into `fab` pr
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.
3 | from airflow.api.auth.backend.basic_auth import (
4 | CLIENT_AUTH,
5 | auth_current_user,
- init_app,
6 | requires_authentication,
7 | )
8 + from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import init_app
9 |
10 | CLIENT_AUTH
11 | init_app()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
3 3 | from airflow.api.auth.backend.basic_auth import (
4 4 | CLIENT_AUTH,
5 5 | auth_current_user,
6 |- init_app,
7 6 | requires_authentication,
8 7 | )
8 |+from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import init_app
9 9 |
10 10 | CLIENT_AUTH
11 11 | init_app()
AIR302 [*] `airflow.api.auth.backend.basic_auth.auth_current_user` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:12:1
@@ -58,18 +60,19 @@ AIR302 [*] `airflow.api.auth.backend.basic_auth.auth_current_user` is moved into
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.
2 |
3 | from airflow.api.auth.backend.basic_auth import (
4 | CLIENT_AUTH,
- auth_current_user,
5 | init_app,
6 | requires_authentication,
7 | )
8 + from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import auth_current_user
9 |
10 | CLIENT_AUTH
11 | init_app()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.api.auth.backend.basic_auth import (
4 4 | CLIENT_AUTH,
5 |- auth_current_user,
6 5 | init_app,
7 6 | requires_authentication,
8 7 | )
8 |+from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import auth_current_user
9 9 |
10 10 | CLIENT_AUTH
11 11 | init_app()
AIR302 [*] `airflow.api.auth.backend.basic_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:13:1
@@ -82,16 +85,17 @@ AIR302 [*] `airflow.api.auth.backend.basic_auth.requires_authentication` is move
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.
4 | CLIENT_AUTH,
5 | auth_current_user,
6 | init_app,
- requires_authentication,
7 | )
8 + from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import requires_authentication
9 |
10 | CLIENT_AUTH
11 | init_app()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
4 4 | CLIENT_AUTH,
5 5 | auth_current_user,
6 6 | init_app,
7 |- requires_authentication,
8 7 | )
8 |+from airflow.providers.fab.auth_manager.api.auth.backend.basic_auth import requires_authentication
9 9 |
10 10 | CLIENT_AUTH
11 11 | init_app()
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.log` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:23:1
@@ -104,17 +108,18 @@ AIR302 [*] `airflow.api.auth.backend.kerberos_auth.log` is moved into `fab` prov
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.
16 | CLIENT_AUTH,
17 | find_user,
18 | init_app,
- log,
19 | requires_authentication,
20 | )
21 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import log
22 |
23 | log()
24 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
16 16 | CLIENT_AUTH,
17 17 | find_user,
18 18 | init_app,
19 |- log,
20 19 | requires_authentication,
21 20 | )
21 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import log
22 22 |
23 23 | log()
24 24 | CLIENT_AUTH
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.CLIENT_AUTH` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:24:1
@@ -126,20 +131,21 @@ AIR302 [*] `airflow.api.auth.backend.kerberos_auth.CLIENT_AUTH` is moved into `f
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.
13 | requires_authentication()
14 |
15 | from airflow.api.auth.backend.kerberos_auth import (
- CLIENT_AUTH,
16 | find_user,
17 | init_app,
18 | log,
19 | requires_authentication,
20 | )
21 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import CLIENT_AUTH
22 |
23 | log()
24 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
13 13 | requires_authentication()
14 14 |
15 15 | from airflow.api.auth.backend.kerberos_auth import (
16 |- CLIENT_AUTH,
17 16 | find_user,
18 17 | init_app,
19 18 | log,
20 19 | requires_authentication,
21 20 | )
21 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import CLIENT_AUTH
22 22 |
23 23 | log()
24 24 | CLIENT_AUTH
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.find_user` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:25:1
@@ -152,19 +158,20 @@ AIR302 [*] `airflow.api.auth.backend.kerberos_auth.find_user` is moved into `fab
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.
14 |
15 | from airflow.api.auth.backend.kerberos_auth import (
16 | CLIENT_AUTH,
- find_user,
17 | init_app,
18 | log,
19 | requires_authentication,
20 | )
21 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import find_user
22 |
23 | log()
24 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
14 14 |
15 15 | from airflow.api.auth.backend.kerberos_auth import (
16 16 | CLIENT_AUTH,
17 |- find_user,
18 17 | init_app,
19 18 | log,
20 19 | requires_authentication,
21 20 | )
21 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import find_user
22 22 |
23 23 | log()
24 24 | CLIENT_AUTH
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.init_app` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:26:1
@@ -176,18 +183,19 @@ AIR302 [*] `airflow.api.auth.backend.kerberos_auth.init_app` is moved into `fab`
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.
15 | from airflow.api.auth.backend.kerberos_auth import (
16 | CLIENT_AUTH,
17 | find_user,
- init_app,
18 | log,
19 | requires_authentication,
20 | )
21 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import init_app
22 |
23 | log()
24 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
15 15 | from airflow.api.auth.backend.kerberos_auth import (
16 16 | CLIENT_AUTH,
17 17 | find_user,
18 |- init_app,
19 18 | log,
20 19 | requires_authentication,
21 20 | )
21 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import init_app
22 22 |
23 23 | log()
24 24 | CLIENT_AUTH
AIR302 [*] `airflow.api.auth.backend.kerberos_auth.requires_authentication` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:27:1
@@ -200,16 +208,17 @@ AIR302 [*] `airflow.api.auth.backend.kerberos_auth.requires_authentication` is m
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.
17 | find_user,
18 | init_app,
19 | log,
- requires_authentication,
20 | )
21 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import requires_authentication
22 |
23 | log()
24 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
17 17 | find_user,
18 18 | init_app,
19 19 | log,
20 |- requires_authentication,
21 20 | )
21 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import requires_authentication
22 22 |
23 23 | log()
24 24 | CLIENT_AUTH
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
@@ -222,17 +231,18 @@ AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.log` is mov
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.
30 | CLIENT_AUTH,
31 | find_user,
32 | init_app,
- log,
33 | requires_authentication,
34 | )
35 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import log
36 |
37 | log()
38 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
30 30 | CLIENT_AUTH,
31 31 | find_user,
32 32 | init_app,
33 |- log,
34 33 | requires_authentication,
35 34 | )
35 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import log
36 36 |
37 37 | log()
38 38 | CLIENT_AUTH
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
@@ -244,20 +254,21 @@ AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.CLIENT_AUTH
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.
27 | requires_authentication()
28 |
29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
- CLIENT_AUTH,
30 | find_user,
31 | init_app,
32 | log,
33 | requires_authentication,
34 | )
35 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import CLIENT_AUTH
36 |
37 | log()
38 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
27 27 | requires_authentication()
28 28 |
29 29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
30 |- CLIENT_AUTH,
31 30 | find_user,
32 31 | init_app,
33 32 | log,
34 33 | requires_authentication,
35 34 | )
35 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import CLIENT_AUTH
36 36 |
37 37 | log()
38 38 | CLIENT_AUTH
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
@@ -270,19 +281,20 @@ AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.find_user`
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.
28 |
29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
30 | CLIENT_AUTH,
- find_user,
31 | init_app,
32 | log,
33 | requires_authentication,
34 | )
35 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import find_user
36 |
37 | log()
38 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
28 28 |
29 29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
30 30 | CLIENT_AUTH,
31 |- find_user,
32 31 | init_app,
33 32 | log,
34 33 | requires_authentication,
35 34 | )
35 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import find_user
36 36 |
37 37 | log()
38 38 | CLIENT_AUTH
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
@@ -294,18 +306,19 @@ AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.init_app` i
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.
29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
30 | CLIENT_AUTH,
31 | find_user,
- init_app,
32 | log,
33 | requires_authentication,
34 | )
35 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import init_app
36 |
37 | log()
38 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
29 29 | from airflow.auth.managers.fab.api.auth.backend.kerberos_auth import (
30 30 | CLIENT_AUTH,
31 31 | find_user,
32 |- init_app,
33 32 | log,
34 33 | requires_authentication,
35 34 | )
35 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import init_app
36 36 |
37 37 | log()
38 38 | CLIENT_AUTH
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
@@ -318,16 +331,17 @@ AIR302 [*] `airflow.auth.managers.fab.api.auth.backend.kerberos_auth.requires_au
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.
31 | find_user,
32 | init_app,
33 | log,
- requires_authentication,
34 | )
35 + from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import requires_authentication
36 |
37 | log()
38 | CLIENT_AUTH
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
31 31 | find_user,
32 32 | init_app,
33 33 | log,
34 |- requires_authentication,
35 34 | )
35 |+from airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth import requires_authentication
36 36 |
37 37 | log()
38 38 | CLIENT_AUTH
AIR302 [*] `airflow.auth.managers.fab.fab_auth_manager.FabAuthManager` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:49:1
@@ -340,19 +354,20 @@ AIR302 [*] `airflow.auth.managers.fab.fab_auth_manager.FabAuthManager` is moved
51 | FabAirflowSecurityManagerOverride()
|
help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAuthManager` from `airflow.providers.fab.auth_manager.fab_auth_manager` instead.
40 | init_app()
41 | requires_authentication()
42 |
- from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
43 | from airflow.auth.managers.fab.security_manager.override import (
44 | MAX_NUM_DATABASE_USER_SESSIONS,
45 | FabAirflowSecurityManagerOverride,
46 | )
47 + from airflow.providers.fab.auth_manager.fab_auth_manager import FabAuthManager
48 |
49 | FabAuthManager()
50 | MAX_NUM_DATABASE_USER_SESSIONS
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
40 40 | init_app()
41 41 | requires_authentication()
42 42 |
43 |-from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
44 43 | from airflow.auth.managers.fab.security_manager.override import (
45 44 | MAX_NUM_DATABASE_USER_SESSIONS,
46 45 | FabAirflowSecurityManagerOverride,
47 46 | )
47 |+from airflow.providers.fab.auth_manager.fab_auth_manager import FabAuthManager
48 48 |
49 49 | FabAuthManager()
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
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
@@ -363,17 +378,18 @@ AIR302 [*] `airflow.auth.managers.fab.security_manager.override.MAX_NUM_DATABASE
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.
42 |
43 | from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
44 | from airflow.auth.managers.fab.security_manager.override import (
- MAX_NUM_DATABASE_USER_SESSIONS,
45 | FabAirflowSecurityManagerOverride,
46 | )
47 + from airflow.providers.fab.auth_manager.security_manager.override import MAX_NUM_DATABASE_USER_SESSIONS
48 |
49 | FabAuthManager()
50 | MAX_NUM_DATABASE_USER_SESSIONS
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
42 42 |
43 43 | from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
44 44 | from airflow.auth.managers.fab.security_manager.override import (
45 |- MAX_NUM_DATABASE_USER_SESSIONS,
46 45 | FabAirflowSecurityManagerOverride,
47 46 | )
47 |+from airflow.providers.fab.auth_manager.security_manager.override import MAX_NUM_DATABASE_USER_SESSIONS
48 48 |
49 49 | FabAuthManager()
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
AIR302 [*] `airflow.auth.managers.fab.security_manager.override.FabAirflowSecurityManagerOverride` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:51:1
@@ -386,16 +402,17 @@ AIR302 [*] `airflow.auth.managers.fab.security_manager.override.FabAirflowSecuri
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.
43 | from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
44 | from airflow.auth.managers.fab.security_manager.override import (
45 | MAX_NUM_DATABASE_USER_SESSIONS,
- FabAirflowSecurityManagerOverride,
46 | )
47 + from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride
48 |
49 | FabAuthManager()
50 | MAX_NUM_DATABASE_USER_SESSIONS
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
43 43 | from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
44 44 | from airflow.auth.managers.fab.security_manager.override import (
45 45 | MAX_NUM_DATABASE_USER_SESSIONS,
46 |- FabAirflowSecurityManagerOverride,
47 46 | )
47 |+from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride
48 48 |
49 49 | FabAuthManager()
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
AIR302 [*] `airflow.www.security.FabAirflowSecurityManagerOverride` is moved into `fab` provider in Airflow 3.0;
--> AIR302_fab.py:55:1
@@ -406,11 +423,12 @@ AIR302 [*] `airflow.www.security.FabAirflowSecurityManagerOverride` is moved int
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAirflowSecurityManagerOverride` from `airflow.providers.fab.auth_manager.security_manager.override` instead.
50 | MAX_NUM_DATABASE_USER_SESSIONS
51 | FabAirflowSecurityManagerOverride()
52 |
- from airflow.www.security import FabAirflowSecurityManagerOverride
53 + from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride
54 |
55 | FabAirflowSecurityManagerOverride()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
50 50 | MAX_NUM_DATABASE_USER_SESSIONS
51 51 | FabAirflowSecurityManagerOverride()
52 52 |
53 |-from airflow.www.security import FabAirflowSecurityManagerOverride
53 |+from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride
54 54 |
55 55 | FabAirflowSecurityManagerOverride()

View File

@@ -11,15 +11,16 @@ AIR302 [*] `airflow.hooks.webhdfs_hook.WebHDFSHook` is moved into `apache-hdfs`
7 | WebHdfsSensor()
|
help: Install `apache-airflow-providers-apache-hdfs>=1.0.0` and use `WebHDFSHook` from `airflow.providers.apache.hdfs.hooks.webhdfs` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.webhdfs_hook import WebHDFSHook
3 | from airflow.sensors.web_hdfs_sensor import WebHdfsSensor
4 + from airflow.providers.apache.hdfs.hooks.webhdfs import WebHDFSHook
5 |
6 | WebHDFSHook()
7 | WebHdfsSensor()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.webhdfs_hook import WebHDFSHook
4 3 | from airflow.sensors.web_hdfs_sensor import WebHdfsSensor
4 |+from airflow.providers.apache.hdfs.hooks.webhdfs import WebHDFSHook
5 5 |
6 6 | WebHDFSHook()
7 7 | WebHdfsSensor()
AIR302 [*] `airflow.sensors.web_hdfs_sensor.WebHdfsSensor` is moved into `apache-hdfs` provider in Airflow 3.0;
--> AIR302_hdfs.py:7:1
@@ -29,12 +30,13 @@ AIR302 [*] `airflow.sensors.web_hdfs_sensor.WebHdfsSensor` is moved into `apache
| ^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-apache-hdfs>=1.0.0` and use `WebHdfsSensor` from `airflow.providers.apache.hdfs.sensors.web_hdfs` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.webhdfs_hook import WebHDFSHook
- from airflow.sensors.web_hdfs_sensor import WebHdfsSensor
4 + from airflow.providers.apache.hdfs.sensors.web_hdfs import WebHdfsSensor
5 |
6 | WebHDFSHook()
7 | WebHdfsSensor()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.webhdfs_hook import WebHDFSHook
4 |-from airflow.sensors.web_hdfs_sensor import WebHdfsSensor
4 |+from airflow.providers.apache.hdfs.sensors.web_hdfs import WebHdfsSensor
5 5 |
6 6 | WebHDFSHook()
7 7 | WebHdfsSensor()

View File

@@ -12,22 +12,23 @@ AIR302 [*] `airflow.hooks.hive_hooks.HIVE_QUEUE_PRIORITIES` is moved into `apach
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.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.hive_hooks import (
- HIVE_QUEUE_PRIORITIES,
4 | HiveCliHook,
5 | HiveMetastoreHook,
6 | HiveServer2Hook,
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.hive_hooks import (
4 |- HIVE_QUEUE_PRIORITIES,
5 4 | HiveCliHook,
6 5 | HiveMetastoreHook,
7 6 | HiveServer2Hook,
--------------------------------------------------------------------------------
13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.hooks.hive import HIVE_QUEUE_PRIORITIES
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
14 13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.hooks.hive import HIVE_QUEUE_PRIORITIES
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.hooks.hive_hooks.HiveCliHook` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:19:1
@@ -39,22 +40,23 @@ AIR302 [*] `airflow.hooks.hive_hooks.HiveCliHook` is moved into `apache-hive` pr
21 | HiveServer2Hook()
|
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveCliHook` from `airflow.providers.apache.hive.hooks.hive` instead.
2 |
3 | from airflow.hooks.hive_hooks import (
4 | HIVE_QUEUE_PRIORITIES,
- HiveCliHook,
5 | HiveMetastoreHook,
6 | HiveServer2Hook,
7 | )
Unsafe fix
2 2 |
3 3 | from airflow.hooks.hive_hooks import (
4 4 | HIVE_QUEUE_PRIORITIES,
5 |- HiveCliHook,
6 5 | HiveMetastoreHook,
7 6 | HiveServer2Hook,
8 7 | )
--------------------------------------------------------------------------------
13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.hooks.hive import HiveCliHook
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
14 13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.hooks.hive import HiveCliHook
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.hooks.hive_hooks.HiveMetastoreHook` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:20:1
@@ -66,22 +68,23 @@ AIR302 [*] `airflow.hooks.hive_hooks.HiveMetastoreHook` is moved into `apache-hi
21 | HiveServer2Hook()
|
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveMetastoreHook` from `airflow.providers.apache.hive.hooks.hive` instead.
3 | from airflow.hooks.hive_hooks import (
4 | HIVE_QUEUE_PRIORITIES,
5 | HiveCliHook,
- HiveMetastoreHook,
6 | HiveServer2Hook,
7 | )
8 | from airflow.macros.hive import (
Unsafe fix
3 3 | from airflow.hooks.hive_hooks import (
4 4 | HIVE_QUEUE_PRIORITIES,
5 5 | HiveCliHook,
6 |- HiveMetastoreHook,
7 6 | HiveServer2Hook,
8 7 | )
9 8 | from airflow.macros.hive import (
--------------------------------------------------------------------------------
13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.hooks.hive import HiveMetastoreHook
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
14 13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.hooks.hive import HiveMetastoreHook
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.hooks.hive_hooks.HiveServer2Hook` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:21:1
@@ -94,22 +97,23 @@ AIR302 [*] `airflow.hooks.hive_hooks.HiveServer2Hook` is moved into `apache-hive
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.
4 | HIVE_QUEUE_PRIORITIES,
5 | HiveCliHook,
6 | HiveMetastoreHook,
- HiveServer2Hook,
7 | )
8 | from airflow.macros.hive import (
9 | closest_ds_partition,
Unsafe fix
4 4 | HIVE_QUEUE_PRIORITIES,
5 5 | HiveCliHook,
6 6 | HiveMetastoreHook,
7 |- HiveServer2Hook,
8 7 | )
9 8 | from airflow.macros.hive import (
10 9 | closest_ds_partition,
--------------------------------------------------------------------------------
13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.hooks.hive import HiveServer2Hook
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
14 13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.hooks.hive import HiveServer2Hook
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.macros.hive.closest_ds_partition` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:23:1
@@ -121,21 +125,22 @@ AIR302 [*] `airflow.macros.hive.closest_ds_partition` is moved into `apache-hive
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.
7 | HiveServer2Hook,
8 | )
9 | from airflow.macros.hive import (
- closest_ds_partition,
10 | max_partition,
11 | )
12 | from airflow.operators.hive_operator import HiveOperator
13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.macros.hive import closest_ds_partition
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
7 7 | HiveServer2Hook,
8 8 | )
9 9 | from airflow.macros.hive import (
10 |- closest_ds_partition,
11 10 | max_partition,
12 11 | )
13 12 | from airflow.operators.hive_operator import HiveOperator
14 13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.macros.hive import closest_ds_partition
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.macros.hive.max_partition` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:24:1
@@ -147,20 +152,21 @@ AIR302 [*] `airflow.macros.hive.max_partition` is moved into `apache-hive` provi
26 | HiveOperator()
|
help: Install `apache-airflow-providers-apache-hive>=5.1.0` and use `max_partition` from `airflow.providers.apache.hive.macros.hive` instead.
8 | )
9 | from airflow.macros.hive import (
10 | closest_ds_partition,
- max_partition,
11 | )
12 | from airflow.operators.hive_operator import HiveOperator
13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.macros.hive import max_partition
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
8 8 | )
9 9 | from airflow.macros.hive import (
10 10 | closest_ds_partition,
11 |- max_partition,
12 11 | )
13 12 | from airflow.operators.hive_operator import HiveOperator
14 13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.macros.hive import max_partition
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.operators.hive_operator.HiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:26:1
@@ -173,18 +179,19 @@ AIR302 [*] `airflow.operators.hive_operator.HiveOperator` is moved into `apache-
28 | HiveToMySqlOperator()
|
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveOperator` from `airflow.providers.apache.hive.operators.hive` instead.
10 | closest_ds_partition,
11 | max_partition,
12 | )
- from airflow.operators.hive_operator import HiveOperator
13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.operators.hive import HiveOperator
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
10 10 | closest_ds_partition,
11 11 | max_partition,
12 12 | )
13 |-from airflow.operators.hive_operator import HiveOperator
14 13 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.operators.hive import HiveOperator
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.operators.hive_stats_operator.HiveStatsCollectionOperator` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:27:1
@@ -196,17 +203,18 @@ AIR302 [*] `airflow.operators.hive_stats_operator.HiveStatsCollectionOperator` i
29 | HiveToSambaOperator()
|
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveStatsCollectionOperator` from `airflow.providers.apache.hive.operators.hive_stats` instead.
11 | max_partition,
12 | )
13 | from airflow.operators.hive_operator import HiveOperator
- from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.operators.hive_stats import HiveStatsCollectionOperator
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
11 11 | max_partition,
12 12 | )
13 13 | from airflow.operators.hive_operator import HiveOperator
14 |-from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 14 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.operators.hive_stats import HiveStatsCollectionOperator
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlOperator` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:28:1
@@ -218,16 +226,17 @@ AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlOperator` is moved into `
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.
12 | )
13 | from airflow.operators.hive_operator import HiveOperator
14 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
- from airflow.operators.hive_to_mysql import HiveToMySqlOperator
15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.transfers.hive_to_mysql import HiveToMySqlOperator
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
12 12 | )
13 13 | from airflow.operators.hive_operator import HiveOperator
14 14 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 |-from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 15 | from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.transfers.hive_to_mysql import HiveToMySqlOperator
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.operators.hive_to_samba_operator.HiveToSambaOperator` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:29:1
@@ -238,15 +247,16 @@ AIR302 [*] `airflow.operators.hive_to_samba_operator.HiveToSambaOperator` is mov
| ^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToSambaOperator` from `airflow.providers.apache.hive.transfers.hive_to_samba` instead.
13 | from airflow.operators.hive_operator import HiveOperator
14 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
- from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 + from airflow.providers.apache.hive.transfers.hive_to_samba import HiveToSambaOperator
17 |
18 | HIVE_QUEUE_PRIORITIES
19 | HiveCliHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
13 13 | from airflow.operators.hive_operator import HiveOperator
14 14 | from airflow.operators.hive_stats_operator import HiveStatsCollectionOperator
15 15 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator
16 |-from airflow.operators.hive_to_samba_operator import HiveToSambaOperator
16 |+from airflow.providers.apache.hive.transfers.hive_to_samba import HiveToSambaOperator
17 17 |
18 18 | HIVE_QUEUE_PRIORITIES
19 19 | HiveCliHook()
AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlTransfer` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:34:1
@@ -259,14 +269,15 @@ AIR302 [*] `airflow.operators.hive_to_mysql.HiveToMySqlTransfer` is moved into `
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.
30 |
31 |
32 | from airflow.operators.hive_to_mysql import HiveToMySqlTransfer
33 + from airflow.providers.apache.hive.transfers.hive_to_mysql import HiveToMySqlOperator
34 |
35 | HiveToMySqlTransfer()
36 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
30 30 |
31 31 |
32 32 | from airflow.operators.hive_to_mysql import HiveToMySqlTransfer
33 |+from airflow.providers.apache.hive.transfers.hive_to_mysql import HiveToMySqlOperator
33 34 |
34 35 | HiveToMySqlTransfer()
35 36 |
AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:38:1
@@ -279,15 +290,16 @@ AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveOperator` is moved into `
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.
33 |
34 | HiveToMySqlTransfer()
35 |
- from airflow.operators.mysql_to_hive import MySqlToHiveOperator
36 + from airflow.providers.apache.hive.transfers.mysql_to_hive import MySqlToHiveOperator
37 |
38 | MySqlToHiveOperator()
39 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
33 33 |
34 34 | HiveToMySqlTransfer()
35 35 |
36 |-from airflow.operators.mysql_to_hive import MySqlToHiveOperator
36 |+from airflow.providers.apache.hive.transfers.mysql_to_hive import MySqlToHiveOperator
37 37 |
38 38 | MySqlToHiveOperator()
39 39 |
AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:42:1
@@ -300,14 +312,15 @@ AIR302 [*] `airflow.operators.mysql_to_hive.MySqlToHiveTransfer` is moved into `
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.
38 | MySqlToHiveOperator()
39 |
40 | from airflow.operators.mysql_to_hive import MySqlToHiveTransfer
41 + from airflow.providers.apache.hive.transfers.mysql_to_hive import MySqlToHiveOperator
42 |
43 | MySqlToHiveTransfer()
44 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
38 38 | MySqlToHiveOperator()
39 39 |
40 40 | from airflow.operators.mysql_to_hive import MySqlToHiveTransfer
41 |+from airflow.providers.apache.hive.transfers.mysql_to_hive import MySqlToHiveOperator
41 42 |
42 43 | MySqlToHiveTransfer()
43 44 |
AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:46:1
@@ -320,15 +333,16 @@ AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveOperator` is moved into `
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.
41 |
42 | MySqlToHiveTransfer()
43 |
- from airflow.operators.mssql_to_hive import MsSqlToHiveOperator
44 + from airflow.providers.apache.hive.transfers.mssql_to_hive import MsSqlToHiveOperator
45 |
46 | MsSqlToHiveOperator()
47 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
41 41 |
42 42 | MySqlToHiveTransfer()
43 43 |
44 |-from airflow.operators.mssql_to_hive import MsSqlToHiveOperator
44 |+from airflow.providers.apache.hive.transfers.mssql_to_hive import MsSqlToHiveOperator
45 45 |
46 46 | MsSqlToHiveOperator()
47 47 |
AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:50:1
@@ -341,14 +355,15 @@ AIR302 [*] `airflow.operators.mssql_to_hive.MsSqlToHiveTransfer` is moved into `
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.
46 | MsSqlToHiveOperator()
47 |
48 | from airflow.operators.mssql_to_hive import MsSqlToHiveTransfer
49 + from airflow.providers.apache.hive.transfers.mssql_to_hive import MsSqlToHiveOperator
50 |
51 | MsSqlToHiveTransfer()
52 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
46 46 | MsSqlToHiveOperator()
47 47 |
48 48 | from airflow.operators.mssql_to_hive import MsSqlToHiveTransfer
49 |+from airflow.providers.apache.hive.transfers.mssql_to_hive import MsSqlToHiveOperator
49 50 |
50 51 | MsSqlToHiveTransfer()
51 52 |
AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveOperator` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:54:1
@@ -361,15 +376,16 @@ AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveOperator` is moved int
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.
49 |
50 | MsSqlToHiveTransfer()
51 |
- from airflow.operators.s3_to_hive_operator import S3ToHiveOperator
52 + from airflow.providers.apache.hive.transfers.s3_to_hive import S3ToHiveOperator
53 |
54 | S3ToHiveOperator()
55 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
49 49 |
50 50 | MsSqlToHiveTransfer()
51 51 |
52 |-from airflow.operators.s3_to_hive_operator import S3ToHiveOperator
52 |+from airflow.providers.apache.hive.transfers.s3_to_hive import S3ToHiveOperator
53 53 |
54 54 | S3ToHiveOperator()
55 55 |
AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveTransfer` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:58:1
@@ -382,14 +398,15 @@ AIR302 [*] `airflow.operators.s3_to_hive_operator.S3ToHiveTransfer` is moved int
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.
54 | S3ToHiveOperator()
55 |
56 | from airflow.operators.s3_to_hive_operator import S3ToHiveTransfer
57 + from airflow.providers.apache.hive.transfers.s3_to_hive import S3ToHiveOperator
58 |
59 | S3ToHiveTransfer()
60 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
54 54 | S3ToHiveOperator()
55 55 |
56 56 | from airflow.operators.s3_to_hive_operator import S3ToHiveTransfer
57 |+from airflow.providers.apache.hive.transfers.s3_to_hive import S3ToHiveOperator
57 58 |
58 59 | S3ToHiveTransfer()
59 60 |
AIR302 [*] `airflow.sensors.hive_partition_sensor.HivePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:62:1
@@ -402,15 +419,16 @@ AIR302 [*] `airflow.sensors.hive_partition_sensor.HivePartitionSensor` is moved
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.
57 |
58 | S3ToHiveTransfer()
59 |
- from airflow.sensors.hive_partition_sensor import HivePartitionSensor
60 + from airflow.providers.apache.hive.sensors.hive_partition import HivePartitionSensor
61 |
62 | HivePartitionSensor()
63 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
57 57 |
58 58 | S3ToHiveTransfer()
59 59 |
60 |-from airflow.sensors.hive_partition_sensor import HivePartitionSensor
60 |+from airflow.providers.apache.hive.sensors.hive_partition import HivePartitionSensor
61 61 |
62 62 | HivePartitionSensor()
63 63 |
AIR302 [*] `airflow.sensors.metastore_partition_sensor.MetastorePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:66:1
@@ -423,15 +441,16 @@ AIR302 [*] `airflow.sensors.metastore_partition_sensor.MetastorePartitionSensor`
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.
61 |
62 | HivePartitionSensor()
63 |
- from airflow.sensors.metastore_partition_sensor import MetastorePartitionSensor
64 + from airflow.providers.apache.hive.sensors.metastore_partition import MetastorePartitionSensor
65 |
66 | MetastorePartitionSensor()
67 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
61 61 |
62 62 | HivePartitionSensor()
63 63 |
64 |-from airflow.sensors.metastore_partition_sensor import MetastorePartitionSensor
64 |+from airflow.providers.apache.hive.sensors.metastore_partition import MetastorePartitionSensor
65 65 |
66 66 | MetastorePartitionSensor()
67 67 |
AIR302 [*] `airflow.sensors.named_hive_partition_sensor.NamedHivePartitionSensor` is moved into `apache-hive` provider in Airflow 3.0;
--> AIR302_hive.py:70:1
@@ -442,11 +461,12 @@ AIR302 [*] `airflow.sensors.named_hive_partition_sensor.NamedHivePartitionSensor
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `NamedHivePartitionSensor` from `airflow.providers.apache.hive.sensors.named_hive_partition` instead.
65 |
66 | MetastorePartitionSensor()
67 |
- from airflow.sensors.named_hive_partition_sensor import NamedHivePartitionSensor
68 + from airflow.providers.apache.hive.sensors.named_hive_partition import NamedHivePartitionSensor
69 |
70 | NamedHivePartitionSensor()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
65 65 |
66 66 | MetastorePartitionSensor()
67 67 |
68 |-from airflow.sensors.named_hive_partition_sensor import NamedHivePartitionSensor
68 |+from airflow.providers.apache.hive.sensors.named_hive_partition import NamedHivePartitionSensor
69 69 |
70 70 | NamedHivePartitionSensor()

View File

@@ -12,16 +12,17 @@ AIR302 [*] `airflow.hooks.http_hook.HttpHook` is moved into `http` provider in A
9 | HttpSensor()
|
help: Install `apache-airflow-providers-http>=1.0.0` and use `HttpHook` from `airflow.providers.http.hooks.http` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.http_hook import HttpHook
3 | from airflow.operators.http_operator import SimpleHttpOperator
4 | from airflow.sensors.http_sensor import HttpSensor
5 + from airflow.providers.http.hooks.http import HttpHook
6 |
7 | HttpHook()
8 | SimpleHttpOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.http_hook import HttpHook
4 3 | from airflow.operators.http_operator import SimpleHttpOperator
5 4 | from airflow.sensors.http_sensor import HttpSensor
5 |+from airflow.providers.http.hooks.http import HttpHook
6 6 |
7 7 | HttpHook()
8 8 | SimpleHttpOperator()
AIR302 [*] `airflow.operators.http_operator.SimpleHttpOperator` is moved into `http` provider in Airflow 3.0;
--> AIR302_http.py:8:1
@@ -32,15 +33,17 @@ AIR302 [*] `airflow.operators.http_operator.SimpleHttpOperator` is moved into `h
9 | HttpSensor()
|
help: Install `apache-airflow-providers-http>=5.0.0` and use `HttpOperator` from `airflow.providers.http.operators.http` instead.
3 | from airflow.hooks.http_hook import HttpHook
4 | from airflow.operators.http_operator import SimpleHttpOperator
5 | from airflow.sensors.http_sensor import HttpSensor
6 + from airflow.providers.http.operators.http import HttpOperator
7 |
8 | HttpHook()
- SimpleHttpOperator()
9 + HttpOperator()
10 | HttpSensor()
Safe fix
3 3 | from airflow.hooks.http_hook import HttpHook
4 4 | from airflow.operators.http_operator import SimpleHttpOperator
5 5 | from airflow.sensors.http_sensor import HttpSensor
6 |+from airflow.providers.http.operators.http import HttpOperator
6 7 |
7 8 | HttpHook()
8 |-SimpleHttpOperator()
9 |+HttpOperator()
9 10 | HttpSensor()
AIR302 [*] `airflow.sensors.http_sensor.HttpSensor` is moved into `http` provider in Airflow 3.0;
--> AIR302_http.py:9:1
@@ -51,12 +54,13 @@ AIR302 [*] `airflow.sensors.http_sensor.HttpSensor` is moved into `http` provide
| ^^^^^^^^^^
|
help: Install `apache-airflow-providers-http>=1.0.0` and use `HttpSensor` from `airflow.providers.http.sensors.http` instead.
2 |
3 | from airflow.hooks.http_hook import HttpHook
4 | from airflow.operators.http_operator import SimpleHttpOperator
- from airflow.sensors.http_sensor import HttpSensor
5 + from airflow.providers.http.sensors.http import HttpSensor
6 |
7 | HttpHook()
8 | SimpleHttpOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.hooks.http_hook import HttpHook
4 4 | from airflow.operators.http_operator import SimpleHttpOperator
5 |-from airflow.sensors.http_sensor import HttpSensor
5 |+from airflow.providers.http.sensors.http import HttpSensor
6 6 |
7 7 | HttpHook()
8 8 | SimpleHttpOperator()

View File

@@ -11,17 +11,18 @@ AIR302 [*] `airflow.hooks.jdbc_hook.JdbcHook` is moved into `jdbc` provider in A
9 | jaydebeapi()
|
help: Install `apache-airflow-providers-jdbc>=1.0.0` and use `JdbcHook` from `airflow.providers.jdbc.hooks.jdbc` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.jdbc_hook import (
- JdbcHook,
4 | jaydebeapi,
5 | )
6 + from airflow.providers.jdbc.hooks.jdbc import JdbcHook
7 |
8 | JdbcHook()
9 | jaydebeapi()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.jdbc_hook import (
4 |- JdbcHook,
5 4 | jaydebeapi,
6 5 | )
6 |+from airflow.providers.jdbc.hooks.jdbc import JdbcHook
7 7 |
8 8 | JdbcHook()
9 9 | jaydebeapi()
AIR302 [*] `airflow.hooks.jdbc_hook.jaydebeapi` is moved into `jdbc` provider in Airflow 3.0;
--> AIR302_jdbc.py:9:1
@@ -31,13 +32,14 @@ AIR302 [*] `airflow.hooks.jdbc_hook.jaydebeapi` is moved into `jdbc` provider in
| ^^^^^^^^^^
|
help: Install `apache-airflow-providers-jdbc>=1.0.0` and use `jaydebeapi` from `airflow.providers.jdbc.hooks.jdbc` instead.
2 |
3 | from airflow.hooks.jdbc_hook import (
4 | JdbcHook,
- jaydebeapi,
5 | )
6 + from airflow.providers.jdbc.hooks.jdbc import jaydebeapi
7 |
8 | JdbcHook()
9 | jaydebeapi()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.hooks.jdbc_hook import (
4 4 | JdbcHook,
5 |- jaydebeapi,
6 5 | )
6 |+from airflow.providers.jdbc.hooks.jdbc import jaydebeapi
7 7 |
8 8 | JdbcHook()
9 9 | jaydebeapi()

View File

@@ -12,18 +12,19 @@ AIR302 [*] `airflow.hooks.mysql_hook.MySqlHook` is moved into `mysql` provider i
11 | PrestoToMySqlTransfer()
|
help: Install `apache-airflow-providers-mysql>=1.0.0` and use `MySqlHook` from `airflow.providers.mysql.hooks.mysql` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.mysql_hook import MySqlHook
3 | from airflow.operators.presto_to_mysql import (
4 | PrestoToMySqlOperator,
5 | PrestoToMySqlTransfer,
6 | )
7 + from airflow.providers.mysql.hooks.mysql import MySqlHook
8 |
9 | MySqlHook()
10 | PrestoToMySqlOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.mysql_hook import MySqlHook
4 3 | from airflow.operators.presto_to_mysql import (
5 4 | PrestoToMySqlOperator,
6 5 | PrestoToMySqlTransfer,
7 6 | )
7 |+from airflow.providers.mysql.hooks.mysql import MySqlHook
8 8 |
9 9 | MySqlHook()
10 10 | PrestoToMySqlOperator()
AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlOperator` is moved into `mysql` provider in Airflow 3.0;
--> AIR302_mysql.py:10:1
@@ -34,17 +35,18 @@ AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlOperator` is moved in
11 | PrestoToMySqlTransfer()
|
help: Install `apache-airflow-providers-mysql>=1.0.0` and use `PrestoToMySqlOperator` from `airflow.providers.mysql.transfers.presto_to_mysql` instead.
2 |
3 | from airflow.hooks.mysql_hook import MySqlHook
4 | from airflow.operators.presto_to_mysql import (
- PrestoToMySqlOperator,
5 | PrestoToMySqlTransfer,
6 | )
7 + from airflow.providers.mysql.transfers.presto_to_mysql import PrestoToMySqlOperator
8 |
9 | MySqlHook()
10 | PrestoToMySqlOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.hooks.mysql_hook import MySqlHook
4 4 | from airflow.operators.presto_to_mysql import (
5 |- PrestoToMySqlOperator,
6 5 | PrestoToMySqlTransfer,
7 6 | )
7 |+from airflow.providers.mysql.transfers.presto_to_mysql import PrestoToMySqlOperator
8 8 |
9 9 | MySqlHook()
10 10 | PrestoToMySqlOperator()
AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlTransfer` is moved into `mysql` provider in Airflow 3.0;
--> AIR302_mysql.py:11:1
@@ -55,14 +57,15 @@ AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlTransfer` is moved in
| ^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-mysql>=1.0.0` and use `PrestoToMySqlOperator` from `airflow.providers.mysql.transfers.presto_to_mysql` instead.
2 |
3 | from airflow.hooks.mysql_hook import MySqlHook
4 | from airflow.operators.presto_to_mysql import (
- PrestoToMySqlOperator,
5 | PrestoToMySqlTransfer,
6 | )
7 + from airflow.providers.mysql.transfers.presto_to_mysql import PrestoToMySqlOperator
8 |
9 | MySqlHook()
10 | PrestoToMySqlOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 |
3 3 | from airflow.hooks.mysql_hook import MySqlHook
4 4 | from airflow.operators.presto_to_mysql import (
5 |- PrestoToMySqlOperator,
6 5 | PrestoToMySqlTransfer,
7 6 | )
7 |+from airflow.providers.mysql.transfers.presto_to_mysql import PrestoToMySqlOperator
8 8 |
9 9 | MySqlHook()
10 10 | PrestoToMySqlOperator()

View File

@@ -10,10 +10,11 @@ AIR302 [*] `airflow.hooks.oracle_hook.OracleHook` is moved into `oracle` provide
| ^^^^^^^^^^
|
help: Install `apache-airflow-providers-oracle>=1.0.0` and use `OracleHook` from `airflow.providers.oracle.hooks.oracle` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.oracle_hook import OracleHook
3 + from airflow.providers.oracle.hooks.oracle import OracleHook
4 |
5 | OracleHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.oracle_hook import OracleHook
3 |+from airflow.providers.oracle.hooks.oracle import OracleHook
4 4 |
5 5 | OracleHook()

View File

@@ -10,10 +10,11 @@ AIR302 [*] `airflow.operators.papermill_operator.PapermillOperator` is moved int
| ^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-papermill>=1.0.0` and use `PapermillOperator` from `airflow.providers.papermill.operators.papermill` instead.
1 | from __future__ import annotations
2 |
- from airflow.operators.papermill_operator import PapermillOperator
3 + from airflow.providers.papermill.operators.papermill import PapermillOperator
4 |
5 | PapermillOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.operators.papermill_operator import PapermillOperator
3 |+from airflow.providers.papermill.operators.papermill import PapermillOperator
4 4 |
5 5 | PapermillOperator()

View File

@@ -11,15 +11,16 @@ AIR302 [*] `airflow.hooks.pig_hook.PigCliHook` is moved into `apache-pig` provid
7 | PigOperator()
|
help: Install `apache-airflow-providers-apache-pig>=1.0.0` and use `PigCliHook` from `airflow.providers.apache.pig.hooks.pig` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.pig_hook import PigCliHook
3 | from airflow.operators.pig_operator import PigOperator
4 + from airflow.providers.apache.pig.hooks.pig import PigCliHook
5 |
6 | PigCliHook()
7 | PigOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.pig_hook import PigCliHook
4 3 | from airflow.operators.pig_operator import PigOperator
4 |+from airflow.providers.apache.pig.hooks.pig import PigCliHook
5 5 |
6 6 | PigCliHook()
7 7 | PigOperator()
AIR302 [*] `airflow.operators.pig_operator.PigOperator` is moved into `apache-pig` provider in Airflow 3.0;
--> AIR302_pig.py:7:1
@@ -29,12 +30,13 @@ AIR302 [*] `airflow.operators.pig_operator.PigOperator` is moved into `apache-pi
| ^^^^^^^^^^^
|
help: Install `apache-airflow-providers-apache-pig>=1.0.0` and use `PigOperator` from `airflow.providers.apache.pig.operators.pig` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.pig_hook import PigCliHook
- from airflow.operators.pig_operator import PigOperator
4 + from airflow.providers.apache.pig.operators.pig import PigOperator
5 |
6 | PigCliHook()
7 | PigOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.pig_hook import PigCliHook
4 |-from airflow.operators.pig_operator import PigOperator
4 |+from airflow.providers.apache.pig.operators.pig import PigOperator
5 5 |
6 6 | PigCliHook()
7 7 | PigOperator()

View File

@@ -11,12 +11,21 @@ AIR302 [*] `airflow.hooks.postgres_hook.PostgresHook` is moved into `postgres` p
7 | Mapping()
|
help: Install `apache-airflow-providers-postgres>=1.0.0` and use `PostgresHook` from `airflow.providers.postgres.hooks.postgres` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.postgres_hook import PostgresHook
3 | from airflow.operators.postgres_operator import Mapping
4 + from airflow.providers.postgres.hooks.postgres import PostgresHook
5 |
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.postgres_hook import PostgresHook
4 3 | from airflow.operators.postgres_operator import Mapping
4 |+from airflow.providers.postgres.hooks.postgres import PostgresHook
5 5 |
6 6 | PostgresHook()
7 7 | Mapping()
AIR302 `airflow.operators.postgres_operator.Mapping` is removed in Airflow 3.0
--> AIR302_postgres.py:7:1
|
6 | PostgresHook()
7 | Mapping()
note: This is an unsafe fix and may change runtime behavior
| ^^^^^^^
|

View File

@@ -10,10 +10,11 @@ AIR302 [*] `airflow.hooks.presto_hook.PrestoHook` is moved into `presto` provide
| ^^^^^^^^^^
|
help: Install `apache-airflow-providers-presto>=1.0.0` and use `PrestoHook` from `airflow.providers.presto.hooks.presto` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.presto_hook import PrestoHook
3 + from airflow.providers.presto.hooks.presto import PrestoHook
4 |
5 | PrestoHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.presto_hook import PrestoHook
3 |+from airflow.providers.presto.hooks.presto import PrestoHook
4 4 |
5 5 | PrestoHook()

View File

@@ -10,10 +10,11 @@ AIR302 [*] `airflow.hooks.samba_hook.SambaHook` is moved into `samba` provider i
| ^^^^^^^^^
|
help: Install `apache-airflow-providers-samba>=1.0.0` and use `SambaHook` from `airflow.providers.samba.hooks.samba` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.samba_hook import SambaHook
3 + from airflow.providers.samba.hooks.samba import SambaHook
4 |
5 | SambaHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.samba_hook import SambaHook
3 |+from airflow.providers.samba.hooks.samba import SambaHook
4 4 |
5 5 | SambaHook()

View File

@@ -12,15 +12,16 @@ AIR302 [*] `airflow.hooks.slack_hook.SlackHook` is moved into `slack` provider i
8 | SlackAPIPostOperator()
|
help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackHook` from `airflow.providers.slack.hooks.slack` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.slack_hook import SlackHook
3 | from airflow.operators.slack_operator import SlackAPIOperator, SlackAPIPostOperator
4 + from airflow.providers.slack.hooks.slack import SlackHook
5 |
6 | SlackHook()
7 | SlackAPIOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.slack_hook import SlackHook
4 3 | from airflow.operators.slack_operator import SlackAPIOperator, SlackAPIPostOperator
4 |+from airflow.providers.slack.hooks.slack import SlackHook
5 5 |
6 6 | SlackHook()
7 7 | SlackAPIOperator()
AIR302 [*] `airflow.operators.slack_operator.SlackAPIOperator` is moved into `slack` provider in Airflow 3.0;
--> AIR302_slack.py:7:1
@@ -31,16 +32,17 @@ AIR302 [*] `airflow.operators.slack_operator.SlackAPIOperator` is moved into `sl
8 | SlackAPIPostOperator()
|
help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackAPIOperator` from `airflow.providers.slack.operators.slack` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.slack_hook import SlackHook
- from airflow.operators.slack_operator import SlackAPIOperator, SlackAPIPostOperator
4 + from airflow.operators.slack_operator import SlackAPIPostOperator
5 + from airflow.providers.slack.operators.slack import SlackAPIOperator
6 |
7 | SlackHook()
8 | SlackAPIOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.slack_hook import SlackHook
4 |-from airflow.operators.slack_operator import SlackAPIOperator, SlackAPIPostOperator
4 |+from airflow.operators.slack_operator import SlackAPIPostOperator
5 |+from airflow.providers.slack.operators.slack import SlackAPIOperator
5 6 |
6 7 | SlackHook()
7 8 | SlackAPIOperator()
AIR302 [*] `airflow.operators.slack_operator.SlackAPIPostOperator` is moved into `slack` provider in Airflow 3.0;
--> AIR302_slack.py:8:1
@@ -51,13 +53,14 @@ AIR302 [*] `airflow.operators.slack_operator.SlackAPIPostOperator` is moved into
| ^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackAPIPostOperator` from `airflow.providers.slack.operators.slack` instead.
1 | from __future__ import annotations
2 |
3 | from airflow.hooks.slack_hook import SlackHook
- from airflow.operators.slack_operator import SlackAPIOperator, SlackAPIPostOperator
4 + from airflow.operators.slack_operator import SlackAPIOperator
5 + from airflow.providers.slack.operators.slack import SlackAPIPostOperator
6 |
7 | SlackHook()
8 | SlackAPIOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 3 | from airflow.hooks.slack_hook import SlackHook
4 |-from airflow.operators.slack_operator import SlackAPIOperator, SlackAPIPostOperator
4 |+from airflow.operators.slack_operator import SlackAPIOperator
5 |+from airflow.providers.slack.operators.slack import SlackAPIPostOperator
5 6 |
6 7 | SlackHook()
7 8 | SlackAPIOperator()

View File

@@ -12,14 +12,15 @@ AIR302 [*] `airflow.operators.email_operator.EmailOperator` is moved into `smtp`
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.
1 | from __future__ import annotations
2 |
- from airflow.operators.email_operator import EmailOperator
3 + from airflow.providers.smtp.operators.smtp import EmailOperator
4 |
5 | EmailOperator()
6 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.operators.email_operator import EmailOperator
3 |+from airflow.providers.smtp.operators.smtp import EmailOperator
4 4 |
5 5 | EmailOperator()
6 6 |
AIR302 [*] `airflow.operators.email.EmailOperator` is moved into `smtp` provider in Airflow 3.0;
--> AIR302_smtp.py:9:1
@@ -30,11 +31,12 @@ AIR302 [*] `airflow.operators.email.EmailOperator` is moved into `smtp` provider
| ^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-smtp>=1.0.0` and use `EmailOperator` from `airflow.providers.smtp.operators.smtp` instead.
4 |
5 | EmailOperator()
6 |
- from airflow.operators.email import EmailOperator
7 + from airflow.providers.smtp.operators.smtp import EmailOperator
8 |
9 | EmailOperator()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
4 4 |
5 5 | EmailOperator()
6 6 |
7 |-from airflow.operators.email import EmailOperator
7 |+from airflow.providers.smtp.operators.smtp import EmailOperator
8 8 |
9 9 | EmailOperator()

View File

@@ -10,10 +10,11 @@ AIR302 [*] `airflow.hooks.sqlite_hook.SqliteHook` is moved into `sqlite` provide
| ^^^^^^^^^^
|
help: Install `apache-airflow-providers-sqlite>=1.0.0` and use `SqliteHook` from `airflow.providers.sqlite.hooks.sqlite` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.sqlite_hook import SqliteHook
3 + from airflow.providers.sqlite.hooks.sqlite import SqliteHook
4 |
5 | SqliteHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.sqlite_hook import SqliteHook
3 |+from airflow.providers.sqlite.hooks.sqlite import SqliteHook
4 4 |
5 5 | SqliteHook()

View File

@@ -12,21 +12,22 @@ AIR302 [*] `airflow.operators.bash_operator.BashOperator` is moved into `standar
22 | TriggerDagRunLink()
|
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BashOperator` from `airflow.providers.standard.operators.bash` instead.
1 | from __future__ import annotations
2 |
- from airflow.operators.bash_operator import BashOperator
3 | from airflow.operators.dagrun_operator import (
4 | TriggerDagRunLink,
5 | TriggerDagRunOperator,
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.operators.bash_operator import BashOperator
4 3 | from airflow.operators.dagrun_operator import (
5 4 | TriggerDagRunLink,
6 5 | TriggerDagRunOperator,
--------------------------------------------------------------------------------
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.bash import BashOperator
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.bash import BashOperator
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunLink` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:22:1
@@ -38,22 +39,23 @@ AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunLink` is moved into `
23 | TriggerDagRunOperator()
|
help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunLink` from `airflow.providers.standard.operators.trigger_dagrun` instead.
2 |
3 | from airflow.operators.bash_operator import BashOperator
4 | from airflow.operators.dagrun_operator import (
- TriggerDagRunLink,
5 | TriggerDagRunOperator,
6 | )
7 | from airflow.operators.latest_only_operator import LatestOnlyOperator
Unsafe fix
2 2 |
3 3 | from airflow.operators.bash_operator import BashOperator
4 4 | from airflow.operators.dagrun_operator import (
5 |- TriggerDagRunLink,
6 5 | TriggerDagRunOperator,
7 6 | )
8 7 | from airflow.operators.latest_only_operator import LatestOnlyOperator
--------------------------------------------------------------------------------
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.trigger_dagrun import TriggerDagRunLink
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.trigger_dagrun import TriggerDagRunLink
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:23:1
@@ -65,22 +67,23 @@ AIR302 [*] `airflow.operators.dagrun_operator.TriggerDagRunOperator` is moved in
25 | LatestOnlyOperator()
|
help: Install `apache-airflow-providers-standard>=0.0.2` and use `TriggerDagRunOperator` from `airflow.providers.standard.operators.trigger_dagrun` instead.
3 | from airflow.operators.bash_operator import BashOperator
4 | from airflow.operators.dagrun_operator import (
5 | TriggerDagRunLink,
- TriggerDagRunOperator,
6 | )
7 | from airflow.operators.latest_only_operator import LatestOnlyOperator
8 | from airflow.operators.python_operator import (
Unsafe fix
3 3 | from airflow.operators.bash_operator import BashOperator
4 4 | from airflow.operators.dagrun_operator import (
5 5 | TriggerDagRunLink,
6 |- TriggerDagRunOperator,
7 6 | )
8 7 | from airflow.operators.latest_only_operator import LatestOnlyOperator
9 8 | from airflow.operators.python_operator import (
--------------------------------------------------------------------------------
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.trigger_dagrun import TriggerDagRunOperator
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.trigger_dagrun import TriggerDagRunOperator
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.operators.latest_only_operator.LatestOnlyOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:25:1
@@ -93,22 +96,23 @@ AIR302 [*] `airflow.operators.latest_only_operator.LatestOnlyOperator` is moved
27 | BranchPythonOperator()
|
help: Install `apache-airflow-providers-standard>=0.0.3` and use `LatestOnlyOperator` from `airflow.providers.standard.operators.latest_only` instead.
5 | TriggerDagRunLink,
6 | TriggerDagRunOperator,
7 | )
- from airflow.operators.latest_only_operator import LatestOnlyOperator
8 | from airflow.operators.python_operator import (
9 | BranchPythonOperator,
10 | PythonOperator,
Unsafe fix
5 5 | TriggerDagRunLink,
6 6 | TriggerDagRunOperator,
7 7 | )
8 |-from airflow.operators.latest_only_operator import LatestOnlyOperator
9 8 | from airflow.operators.python_operator import (
10 9 | BranchPythonOperator,
11 10 | PythonOperator,
--------------------------------------------------------------------------------
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.latest_only import LatestOnlyOperator
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.latest_only import LatestOnlyOperator
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.operators.python_operator.BranchPythonOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:27:1
@@ -121,22 +125,23 @@ AIR302 [*] `airflow.operators.python_operator.BranchPythonOperator` is moved int
29 | PythonVirtualenvOperator()
|
help: Install `apache-airflow-providers-standard>=0.0.1` and use `BranchPythonOperator` from `airflow.providers.standard.operators.python` instead.
7 | )
8 | from airflow.operators.latest_only_operator import LatestOnlyOperator
9 | from airflow.operators.python_operator import (
- BranchPythonOperator,
10 | PythonOperator,
11 | PythonVirtualenvOperator,
12 | ShortCircuitOperator,
Unsafe fix
7 7 | )
8 8 | from airflow.operators.latest_only_operator import LatestOnlyOperator
9 9 | from airflow.operators.python_operator import (
10 |- BranchPythonOperator,
11 10 | PythonOperator,
12 11 | PythonVirtualenvOperator,
13 12 | ShortCircuitOperator,
--------------------------------------------------------------------------------
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.python import BranchPythonOperator
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.python import BranchPythonOperator
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.operators.python_operator.PythonOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:28:1
@@ -148,22 +153,23 @@ AIR302 [*] `airflow.operators.python_operator.PythonOperator` is moved into `sta
30 | ShortCircuitOperator()
|
help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonOperator` from `airflow.providers.standard.operators.python` instead.
8 | from airflow.operators.latest_only_operator import LatestOnlyOperator
9 | from airflow.operators.python_operator import (
10 | BranchPythonOperator,
- PythonOperator,
11 | PythonVirtualenvOperator,
12 | ShortCircuitOperator,
13 | )
Unsafe fix
8 8 | from airflow.operators.latest_only_operator import LatestOnlyOperator
9 9 | from airflow.operators.python_operator import (
10 10 | BranchPythonOperator,
11 |- PythonOperator,
12 11 | PythonVirtualenvOperator,
13 12 | ShortCircuitOperator,
14 13 | )
--------------------------------------------------------------------------------
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.python import PythonOperator
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.python import PythonOperator
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.operators.python_operator.PythonVirtualenvOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:29:1
@@ -175,21 +181,22 @@ AIR302 [*] `airflow.operators.python_operator.PythonVirtualenvOperator` is moved
30 | ShortCircuitOperator()
|
help: Install `apache-airflow-providers-standard>=0.0.1` and use `PythonVirtualenvOperator` from `airflow.providers.standard.operators.python` instead.
9 | from airflow.operators.python_operator import (
10 | BranchPythonOperator,
11 | PythonOperator,
- PythonVirtualenvOperator,
12 | ShortCircuitOperator,
13 | )
14 | from airflow.sensors.external_task_sensor import (
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.python import PythonVirtualenvOperator
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
9 9 | from airflow.operators.python_operator import (
10 10 | BranchPythonOperator,
11 11 | PythonOperator,
12 |- PythonVirtualenvOperator,
13 12 | ShortCircuitOperator,
14 13 | )
15 14 | from airflow.sensors.external_task_sensor import (
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.python import PythonVirtualenvOperator
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.operators.python_operator.ShortCircuitOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:30:1
@@ -202,20 +209,21 @@ AIR302 [*] `airflow.operators.python_operator.ShortCircuitOperator` is moved int
32 | ExternalTaskMarker()
|
help: Install `apache-airflow-providers-standard>=0.0.1` and use `ShortCircuitOperator` from `airflow.providers.standard.operators.python` instead.
10 | BranchPythonOperator,
11 | PythonOperator,
12 | PythonVirtualenvOperator,
- ShortCircuitOperator,
13 | )
14 | from airflow.sensors.external_task_sensor import (
15 | ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.operators.python import ShortCircuitOperator
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
10 10 | BranchPythonOperator,
11 11 | PythonOperator,
12 12 | PythonVirtualenvOperator,
13 |- ShortCircuitOperator,
14 13 | )
15 14 | from airflow.sensors.external_task_sensor import (
16 15 | ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.operators.python import ShortCircuitOperator
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskMarker` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:32:1
@@ -227,17 +235,18 @@ AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskMarker` is moved in
33 | ExternalTaskSensor()
|
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskMarker` from `airflow.providers.standard.sensors.external_task` instead.
13 | ShortCircuitOperator,
14 | )
15 | from airflow.sensors.external_task_sensor import (
- ExternalTaskMarker,
16 | ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.sensors.external_task import ExternalTaskMarker
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
13 13 | ShortCircuitOperator,
14 14 | )
15 15 | from airflow.sensors.external_task_sensor import (
16 |- ExternalTaskMarker,
17 16 | ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.sensors.external_task import ExternalTaskMarker
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensor` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:33:1
@@ -247,16 +256,17 @@ AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensor` is moved in
| ^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskSensor` from `airflow.providers.standard.sensors.external_task` instead.
14 | )
15 | from airflow.sensors.external_task_sensor import (
16 | ExternalTaskMarker,
- ExternalTaskSensor,
17 | )
18 + from airflow.providers.standard.sensors.external_task import ExternalTaskSensor
19 |
20 | BashOperator()
21 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
14 14 | )
15 15 | from airflow.sensors.external_task_sensor import (
16 16 | ExternalTaskMarker,
17 |- ExternalTaskSensor,
18 17 | )
18 |+from airflow.providers.standard.sensors.external_task import ExternalTaskSensor
19 19 |
20 20 | BashOperator()
21 21 |
AIR302 [*] `airflow.hooks.subprocess.SubprocessResult` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:38:1
@@ -269,15 +279,16 @@ AIR302 [*] `airflow.hooks.subprocess.SubprocessResult` is moved into `standard`
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.
33 | ExternalTaskSensor()
34 |
35 |
- from airflow.hooks.subprocess import SubprocessResult
36 + from airflow.providers.standard.hooks.subprocess import SubprocessResult
37 |
38 | SubprocessResult()
39 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
33 33 | ExternalTaskSensor()
34 34 |
35 35 |
36 |-from airflow.hooks.subprocess import SubprocessResult
36 |+from airflow.providers.standard.hooks.subprocess import SubprocessResult
37 37 |
38 38 | SubprocessResult()
39 39 |
AIR302 [*] `airflow.hooks.subprocess.working_directory` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:42:1
@@ -290,15 +301,16 @@ AIR302 [*] `airflow.hooks.subprocess.working_directory` is moved into `standard`
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.
37 |
38 | SubprocessResult()
39 |
- from airflow.hooks.subprocess import working_directory
40 + from airflow.providers.standard.hooks.subprocess import working_directory
41 |
42 | working_directory()
43 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
37 37 |
38 38 | SubprocessResult()
39 39 |
40 |-from airflow.hooks.subprocess import working_directory
40 |+from airflow.providers.standard.hooks.subprocess import working_directory
41 41 |
42 42 | working_directory()
43 43 |
AIR302 [*] `airflow.operators.datetime.target_times_as_dates` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:46:1
@@ -311,15 +323,16 @@ AIR302 [*] `airflow.operators.datetime.target_times_as_dates` is moved into `sta
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.
41 |
42 | working_directory()
43 |
- from airflow.operators.datetime import target_times_as_dates
44 + from airflow.providers.standard.operators.datetime import target_times_as_dates
45 |
46 | target_times_as_dates()
47 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
41 41 |
42 42 | working_directory()
43 43 |
44 |-from airflow.operators.datetime import target_times_as_dates
44 |+from airflow.providers.standard.operators.datetime import target_times_as_dates
45 45 |
46 46 | target_times_as_dates()
47 47 |
AIR302 [*] `airflow.operators.trigger_dagrun.TriggerDagRunLink` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:50:1
@@ -332,15 +345,16 @@ AIR302 [*] `airflow.operators.trigger_dagrun.TriggerDagRunLink` is moved into `s
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.
45 |
46 | target_times_as_dates()
47 |
- from airflow.operators.trigger_dagrun import TriggerDagRunLink
48 + from airflow.providers.standard.operators.trigger_dagrun import TriggerDagRunLink
49 |
50 | TriggerDagRunLink()
51 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
45 45 |
46 46 | target_times_as_dates()
47 47 |
48 |-from airflow.operators.trigger_dagrun import TriggerDagRunLink
48 |+from airflow.providers.standard.operators.trigger_dagrun import TriggerDagRunLink
49 49 |
50 50 | TriggerDagRunLink()
51 51 |
AIR302 [*] `airflow.sensors.external_task.ExternalTaskSensorLink` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:54:1
@@ -353,16 +367,18 @@ AIR302 [*] `airflow.sensors.external_task.ExternalTaskSensorLink` is moved into
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.
50 | TriggerDagRunLink()
51 |
52 | from airflow.sensors.external_task import ExternalTaskSensorLink
53 + from airflow.providers.standard.sensors.external_task import ExternalDagLink
54 |
- ExternalTaskSensorLink()
55 + ExternalDagLink()
56 |
57 | from airflow.sensors.time_delta import WaitSensor
58 |
Safe fix
50 50 | TriggerDagRunLink()
51 51 |
52 52 | from airflow.sensors.external_task import ExternalTaskSensorLink
53 |+from airflow.providers.standard.sensors.external_task import ExternalDagLink
53 54 |
54 |-ExternalTaskSensorLink()
55 |+ExternalDagLink()
55 56 |
56 57 | from airflow.sensors.time_delta import WaitSensor
57 58 |
AIR302 [*] `airflow.sensors.time_delta.WaitSensor` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:58:1
@@ -375,15 +391,16 @@ AIR302 [*] `airflow.sensors.time_delta.WaitSensor` is moved into `standard` prov
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.
53 |
54 | ExternalTaskSensorLink()
55 |
- from airflow.sensors.time_delta import WaitSensor
56 + from airflow.providers.standard.sensors.time_delta import WaitSensor
57 |
58 | WaitSensor()
59 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
53 53 |
54 54 | ExternalTaskSensorLink()
55 55 |
56 |-from airflow.sensors.time_delta import WaitSensor
56 |+from airflow.providers.standard.sensors.time_delta import WaitSensor
57 57 |
58 58 | WaitSensor()
59 59 |
AIR302 [*] `airflow.operators.dummy.DummyOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:62:1
@@ -396,16 +413,18 @@ AIR302 [*] `airflow.operators.dummy.DummyOperator` is moved into `standard` prov
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.
58 | WaitSensor()
59 |
60 | from airflow.operators.dummy import DummyOperator
61 + from airflow.providers.standard.operators.empty import EmptyOperator
62 |
- DummyOperator()
63 + EmptyOperator()
64 |
65 | from airflow.operators.dummy import EmptyOperator
66 |
Safe fix
58 58 | WaitSensor()
59 59 |
60 60 | from airflow.operators.dummy import DummyOperator
61 |+from airflow.providers.standard.operators.empty import EmptyOperator
61 62 |
62 |-DummyOperator()
63 |+EmptyOperator()
63 64 |
64 65 | from airflow.operators.dummy import EmptyOperator
65 66 |
AIR302 [*] `airflow.operators.dummy.EmptyOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:66:1
@@ -418,15 +437,16 @@ AIR302 [*] `airflow.operators.dummy.EmptyOperator` is moved into `standard` prov
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.
61 |
62 | DummyOperator()
63 |
- from airflow.operators.dummy import EmptyOperator
64 + from airflow.providers.standard.operators.empty import EmptyOperator
65 |
66 | EmptyOperator()
67 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
61 61 |
62 62 | DummyOperator()
63 63 |
64 |-from airflow.operators.dummy import EmptyOperator
64 |+from airflow.providers.standard.operators.empty import EmptyOperator
65 65 |
66 66 | EmptyOperator()
67 67 |
AIR302 [*] `airflow.operators.dummy_operator.DummyOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:70:1
@@ -439,14 +459,15 @@ AIR302 [*] `airflow.operators.dummy_operator.DummyOperator` is moved into `stand
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.
66 | EmptyOperator()
67 |
68 | from airflow.operators.dummy_operator import DummyOperator
69 + from airflow.providers.standard.operators.empty import EmptyOperator
70 |
71 | DummyOperator()
72 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
66 66 | EmptyOperator()
67 67 |
68 68 | from airflow.operators.dummy_operator import DummyOperator
69 |+from airflow.providers.standard.operators.empty import EmptyOperator
69 70 |
70 71 | DummyOperator()
71 72 |
AIR302 [*] `airflow.operators.dummy_operator.EmptyOperator` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:74:1
@@ -459,15 +480,16 @@ AIR302 [*] `airflow.operators.dummy_operator.EmptyOperator` is moved into `stand
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.
69 |
70 | DummyOperator()
71 |
- from airflow.operators.dummy_operator import EmptyOperator
72 + from airflow.providers.standard.operators.empty import EmptyOperator
73 |
74 | EmptyOperator()
75 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
69 69 |
70 70 | DummyOperator()
71 71 |
72 |-from airflow.operators.dummy_operator import EmptyOperator
72 |+from airflow.providers.standard.operators.empty import EmptyOperator
73 73 |
74 74 | EmptyOperator()
75 75 |
AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is moved into `standard` provider in Airflow 3.0;
--> AIR302_standard.py:78:1
@@ -478,10 +500,12 @@ AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is move
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalDagLink` from `airflow.providers.standard.sensors.external_task` instead.
74 | EmptyOperator()
75 |
76 | from airflow.sensors.external_task_sensor import ExternalTaskSensorLink
77 + from airflow.providers.standard.sensors.external_task import ExternalDagLink
78 |
- ExternalTaskSensorLink()
79 + ExternalDagLink()
Safe fix
74 74 | EmptyOperator()
75 75 |
76 76 | from airflow.sensors.external_task_sensor import ExternalTaskSensorLink
77 |+from airflow.providers.standard.sensors.external_task import ExternalDagLink
77 78 |
78 |-ExternalTaskSensorLink()
79 |+ExternalDagLink()

View File

@@ -10,10 +10,11 @@ AIR302 [*] `airflow.hooks.zendesk_hook.ZendeskHook` is moved into `zendesk` prov
| ^^^^^^^^^^^
|
help: Install `apache-airflow-providers-zendesk>=1.0.0` and use `ZendeskHook` from `airflow.providers.zendesk.hooks.zendesk` instead.
1 | from __future__ import annotations
2 |
- from airflow.hooks.zendesk_hook import ZendeskHook
3 + from airflow.providers.zendesk.hooks.zendesk import ZendeskHook
4 |
5 | ZendeskHook()
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 1 | from __future__ import annotations
2 2 |
3 |-from airflow.hooks.zendesk_hook import ZendeskHook
3 |+from airflow.providers.zendesk.hooks.zendesk import ZendeskHook
4 4 |
5 5 | ZendeskHook()

View File

@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/eradicate/mod.rs
---
ERA001 [*] Found commented-out code
ERA001 Found commented-out code
--> ERA001.py:1:1
|
1 | #import os
@@ -10,13 +10,14 @@ ERA001 [*] Found commented-out code
3 | #a = 3
|
help: Remove commented-out code
- #import os
1 | # from foo import junk
2 | #a = 3
3 | a = 4
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
1 |-#import os
2 1 | # from foo import junk
3 2 | #a = 3
4 3 | a = 4
ERA001 Found commented-out code
--> ERA001.py:2:1
|
1 | #import os
@@ -26,14 +27,15 @@ ERA001 [*] Found commented-out code
4 | a = 4
|
help: Remove commented-out code
1 | #import os
- # from foo import junk
2 | #a = 3
3 | a = 4
4 | #foo(1, 2, 3)
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
1 1 | #import os
2 |-# from foo import junk
3 2 | #a = 3
4 3 | a = 4
5 4 | #foo(1, 2, 3)
ERA001 Found commented-out code
--> ERA001.py:3:1
|
1 | #import os
@@ -44,15 +46,16 @@ ERA001 [*] Found commented-out code
5 | #foo(1, 2, 3)
|
help: Remove commented-out code
1 | #import os
2 | # from foo import junk
- #a = 3
3 | a = 4
4 | #foo(1, 2, 3)
5 |
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
1 1 | #import os
2 2 | # from foo import junk
3 |-#a = 3
4 3 | a = 4
5 4 | #foo(1, 2, 3)
6 5 |
ERA001 Found commented-out code
--> ERA001.py:5:1
|
3 | #a = 3
@@ -63,16 +66,17 @@ ERA001 [*] Found commented-out code
7 | def foo(x, y, z):
|
help: Remove commented-out code
2 | # from foo import junk
3 | #a = 3
4 | a = 4
- #foo(1, 2, 3)
5 |
6 | def foo(x, y, z):
7 | content = 1 # print('hello')
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
2 2 | # from foo import junk
3 3 | #a = 3
4 4 | a = 4
5 |-#foo(1, 2, 3)
6 5 |
7 6 | def foo(x, y, z):
8 7 | content = 1 # print('hello')
ERA001 Found commented-out code
--> ERA001.py:13:5
|
11 | # This is a real comment.
@@ -82,16 +86,17 @@ ERA001 [*] Found commented-out code
14 | return False
|
help: Remove commented-out code
10 |
11 | # This is a real comment.
12 | # # This is a (nested) comment.
- #return True
13 | return False
14 |
15 | #import os # noqa: ERA001
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
10 10 |
11 11 | # This is a real comment.
12 12 | # # This is a (nested) comment.
13 |- #return True
14 13 | return False
15 14 |
16 15 | #import os # noqa: ERA001
ERA001 Found commented-out code
--> ERA001.py:21:5
|
19 | class A():
@@ -100,16 +105,17 @@ ERA001 [*] Found commented-out code
| ^^^^^^^
|
help: Remove commented-out code
18 |
19 | class A():
20 | pass
- # b = c
21 |
22 |
23 | dictionary = {
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
18 18 |
19 19 | class A():
20 20 | pass
21 |- # b = c
22 21 |
23 22 |
24 23 | dictionary = {
ERA001 Found commented-out code
--> ERA001.py:26:5
|
24 | dictionary = {
@@ -120,16 +126,17 @@ ERA001 [*] Found commented-out code
28 | }
|
help: Remove commented-out code
23 |
24 | dictionary = {
25 | # "key1": 123, # noqa: ERA001
- # "key2": 456,
26 | # "key3": 789, # test
27 | }
28 |
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
23 23 |
24 24 | dictionary = {
25 25 | # "key1": 123, # noqa: ERA001
26 |- # "key2": 456,
27 26 | # "key3": 789, # test
28 27 | }
29 28 |
ERA001 Found commented-out code
--> ERA001.py:27:5
|
25 | # "key1": 123, # noqa: ERA001
@@ -139,16 +146,17 @@ ERA001 [*] Found commented-out code
28 | }
|
help: Remove commented-out code
24 | dictionary = {
25 | # "key1": 123, # noqa: ERA001
26 | # "key2": 456,
- # "key3": 789, # test
27 | }
28 |
29 | #import os # noqa
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
24 24 | dictionary = {
25 25 | # "key1": 123, # noqa: ERA001
26 26 | # "key2": 456,
27 |- # "key3": 789, # test
28 27 | }
29 28 |
30 29 | #import os # noqa
ERA001 Found commented-out code
--> ERA001.py:32:1
|
30 | #import os # noqa
@@ -159,16 +167,17 @@ ERA001 [*] Found commented-out code
34 | # try: # with comment
|
help: Remove commented-out code
29 |
30 | #import os # noqa
31 |
- # case 1:
32 | # try:
33 | # try: # with comment
34 | # try: print()
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
29 29 |
30 30 | #import os # noqa
31 31 |
32 |-# case 1:
33 32 | # try:
34 33 | # try: # with comment
35 34 | # try: print()
ERA001 Found commented-out code
--> ERA001.py:33:1
|
32 | # case 1:
@@ -178,16 +187,17 @@ ERA001 [*] Found commented-out code
35 | # try: print()
|
help: Remove commented-out code
30 | #import os # noqa
31 |
32 | # case 1:
- # try:
33 | # try: # with comment
34 | # try: print()
35 | # except:
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
30 30 | #import os # noqa
31 31 |
32 32 | # case 1:
33 |-# try:
34 33 | # try: # with comment
35 34 | # try: print()
36 35 | # except:
ERA001 Found commented-out code
--> ERA001.py:34:1
|
32 | # case 1:
@@ -198,16 +208,17 @@ ERA001 [*] Found commented-out code
36 | # except:
|
help: Remove commented-out code
31 |
32 | # case 1:
33 | # try:
- # try: # with comment
34 | # try: print()
35 | # except:
36 | # except Foo:
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
31 31 |
32 32 | # case 1:
33 33 | # try:
34 |-# try: # with comment
35 34 | # try: print()
36 35 | # except:
37 36 | # except Foo:
ERA001 Found commented-out code
--> ERA001.py:35:1
|
33 | # try:
@@ -218,16 +229,17 @@ ERA001 [*] Found commented-out code
37 | # except Foo:
|
help: Remove commented-out code
32 | # case 1:
33 | # try:
34 | # try: # with comment
- # try: print()
35 | # except:
36 | # except Foo:
37 | # except Exception as e: print(e)
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
32 32 | # case 1:
33 33 | # try:
34 34 | # try: # with comment
35 |-# try: print()
36 35 | # except:
37 36 | # except Foo:
38 37 | # except Exception as e: print(e)
ERA001 Found commented-out code
--> ERA001.py:36:1
|
34 | # try: # with comment
@@ -238,16 +250,17 @@ ERA001 [*] Found commented-out code
38 | # except Exception as e: print(e)
|
help: Remove commented-out code
33 | # try:
34 | # try: # with comment
35 | # try: print()
- # except:
36 | # except Foo:
37 | # except Exception as e: print(e)
38 |
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
33 33 | # try:
34 34 | # try: # with comment
35 35 | # try: print()
36 |-# except:
37 36 | # except Foo:
38 37 | # except Exception as e: print(e)
39 38 |
ERA001 Found commented-out code
--> ERA001.py:37:1
|
35 | # try: print()
@@ -257,16 +270,17 @@ ERA001 [*] Found commented-out code
38 | # except Exception as e: print(e)
|
help: Remove commented-out code
34 | # try: # with comment
35 | # try: print()
36 | # except:
- # except Foo:
37 | # except Exception as e: print(e)
38 |
39 |
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
34 34 | # try: # with comment
35 35 | # try: print()
36 36 | # except:
37 |-# except Foo:
38 37 | # except Exception as e: print(e)
39 38 |
40 39 |
ERA001 Found commented-out code
--> ERA001.py:38:1
|
36 | # except:
@@ -275,16 +289,17 @@ ERA001 [*] Found commented-out code
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: Remove commented-out code
35 | # try: print()
36 | # except:
37 | # except Foo:
- # except Exception as e: print(e)
38 |
39 |
40 | # Script tag without an opening tag (Error)
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
35 35 | # try: print()
36 36 | # except:
37 37 | # except Foo:
38 |-# except Exception as e: print(e)
39 38 |
40 39 |
41 40 | # Script tag without an opening tag (Error)
ERA001 Found commented-out code
--> ERA001.py:44:1
|
43 | # requires-python = ">=3.11"
@@ -294,16 +309,17 @@ ERA001 [*] Found commented-out code
46 | # "rich",
|
help: Remove commented-out code
41 | # Script tag without an opening tag (Error)
42 |
43 | # requires-python = ">=3.11"
- # dependencies = [
44 | # "requests<3",
45 | # "rich",
46 | # ]
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
41 41 | # Script tag without an opening tag (Error)
42 42 |
43 43 | # requires-python = ">=3.11"
44 |-# dependencies = [
45 44 | # "requests<3",
46 45 | # "rich",
47 46 | # ]
ERA001 Found commented-out code
--> ERA001.py:47:1
|
45 | # "requests<3",
@@ -313,16 +329,17 @@ ERA001 [*] Found commented-out code
48 | # ///
|
help: Remove commented-out code
44 | # dependencies = [
45 | # "requests<3",
46 | # "rich",
- # ]
47 | # ///
48 |
49 | # Script tag (OK)
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
44 44 | # dependencies = [
45 45 | # "requests<3",
46 46 | # "rich",
47 |-# ]
48 47 | # ///
49 48 |
50 49 | # Script tag (OK)
ERA001 Found commented-out code
--> ERA001.py:75:1
|
73 | # /// script
@@ -333,16 +350,17 @@ ERA001 [*] Found commented-out code
77 | # "rich",
|
help: Remove commented-out code
72 |
73 | # /// script
74 | # requires-python = ">=3.11"
- # dependencies = [
75 | # "requests<3",
76 | # "rich",
77 | # ]
note: This is a display-only fix and is likely to be incorrect
ERA001 [*] Found commented-out code
Display-only fix
72 72 |
73 73 | # /// script
74 74 | # requires-python = ">=3.11"
75 |-# dependencies = [
76 75 | # "requests<3",
77 76 | # "rich",
78 77 | # ]
ERA001 Found commented-out code
--> ERA001.py:78:1
|
76 | # "requests<3",
@@ -353,11 +371,12 @@ ERA001 [*] Found commented-out code
80 | # Script tag block followed by normal block (Ok)
|
help: Remove commented-out code
75 | # dependencies = [
76 | # "requests<3",
77 | # "rich",
- # ]
78 |
79 | # Script tag block followed by normal block (Ok)
80 |
note: This is a display-only fix and is likely to be incorrect
Display-only fix
75 75 | # dependencies = [
76 76 | # "requests<3",
77 77 | # "rich",
78 |-# ]
79 78 |
80 79 | # Script tag block followed by normal block (Ok)
81 80 |

View File

@@ -457,9 +457,6 @@ fn parameter_alias<'a>(parameter: &'a Parameter, semantic: &SemanticModel) -> Op
///
/// The iterator yields tuples of the parameter name and the range of the parameter in the input,
/// inclusive of curly braces.
///
/// FastAPI only recognizes path parameters when there are no leading or trailing spaces around
/// the parameter name. For example, `/{x}` is a valid parameter, but `/{ x }` is treated literally.
#[derive(Debug)]
struct PathParamIterator<'a> {
input: &'a str,
@@ -486,7 +483,7 @@ impl<'a> Iterator for PathParamIterator<'a> {
// We ignore text after a colon, since those are path converters
// See also: https://fastapi.tiangolo.com/tutorial/path-params/?h=path#path-convertor
let param_name_end = param_content.find(':').unwrap_or(param_content.len());
let param_name = &param_content[..param_name_end];
let param_name = &param_content[..param_name_end].trim();
#[expect(clippy::range_plus_one)]
return Some((param_name, start..end + 1));

View File

@@ -12,23 +12,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
26 | ):
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
22 |
23 | @app.get("/items/")
24 | def get_items(
- current_user: User = Depends(get_current_user),
25 + current_user: Annotated[User, Depends(get_current_user)],
26 | some_security_param: str = Security(get_oauth2_user),
27 | ):
28 | pass
note: This is an unsafe fix and may change runtime behavior
21 22 |
22 23 | @app.get("/items/")
23 24 | def get_items(
24 |- current_user: User = Depends(get_current_user),
25 |+ current_user: Annotated[User, Depends(get_current_user)],
25 26 | some_security_param: str = Security(get_oauth2_user),
26 27 | ):
27 28 | pass
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:25:5
@@ -41,23 +42,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
27 | pass
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
23 | @app.get("/items/")
24 | def get_items(
25 | current_user: User = Depends(get_current_user),
- some_security_param: str = Security(get_oauth2_user),
26 + some_security_param: Annotated[str, Security(get_oauth2_user)],
27 | ):
28 | pass
29 |
note: This is an unsafe fix and may change runtime behavior
22 23 | @app.get("/items/")
23 24 | def get_items(
24 25 | current_user: User = Depends(get_current_user),
25 |- some_security_param: str = Security(get_oauth2_user),
26 |+ some_security_param: Annotated[str, Security(get_oauth2_user)],
26 27 | ):
27 28 | pass
28 29 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:32:5
@@ -70,23 +72,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
34 | some_file_param: UploadFile = File(),
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
30 |
31 | @app.post("/stuff/")
32 | def do_stuff(
- some_path_param: str = Path(),
33 + some_path_param: Annotated[str, Path()],
34 | some_cookie_param: str = Cookie(),
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
note: This is an unsafe fix and may change runtime behavior
29 30 |
30 31 | @app.post("/stuff/")
31 32 | def do_stuff(
32 |- some_path_param: str = Path(),
33 |+ some_path_param: Annotated[str, Path()],
33 34 | some_cookie_param: str = Cookie(),
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:33:5
@@ -99,23 +102,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
35 | some_form_param: str = Form(),
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
31 | @app.post("/stuff/")
32 | def do_stuff(
33 | some_path_param: str = Path(),
- some_cookie_param: str = Cookie(),
34 + some_cookie_param: Annotated[str, Cookie()],
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
note: This is an unsafe fix and may change runtime behavior
30 31 | @app.post("/stuff/")
31 32 | def do_stuff(
32 33 | some_path_param: str = Path(),
33 |- some_cookie_param: str = Cookie(),
34 |+ some_cookie_param: Annotated[str, Cookie()],
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:34:5
@@ -128,23 +132,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
36 | some_query_param: str | None = Query(default=None),
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
32 | def do_stuff(
33 | some_path_param: str = Path(),
34 | some_cookie_param: str = Cookie(),
- some_file_param: UploadFile = File(),
35 + some_file_param: Annotated[UploadFile, File()],
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
38 | some_body_param: str = Body("foo"),
note: This is an unsafe fix and may change runtime behavior
31 32 | def do_stuff(
32 33 | some_path_param: str = Path(),
33 34 | some_cookie_param: str = Cookie(),
34 |- some_file_param: UploadFile = File(),
35 |+ some_file_param: Annotated[UploadFile, File()],
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
37 38 | some_body_param: str = Body("foo"),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:35:5
@@ -157,23 +162,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
37 | some_body_param: str = Body("foo"),
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
33 | some_path_param: str = Path(),
34 | some_cookie_param: str = Cookie(),
35 | some_file_param: UploadFile = File(),
- some_form_param: str = Form(),
36 + some_form_param: Annotated[str, Form()],
37 | some_query_param: str | None = Query(default=None),
38 | some_body_param: str = Body("foo"),
39 | some_header_param: int = Header(default=5),
note: This is an unsafe fix and may change runtime behavior
32 33 | some_path_param: str = Path(),
33 34 | some_cookie_param: str = Cookie(),
34 35 | some_file_param: UploadFile = File(),
35 |- some_form_param: str = Form(),
36 |+ some_form_param: Annotated[str, Form()],
36 37 | some_query_param: str | None = Query(default=None),
37 38 | some_body_param: str = Body("foo"),
38 39 | some_header_param: int = Header(default=5),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:36:5
@@ -186,23 +192,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
38 | some_header_param: int = Header(default=5),
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
34 | some_cookie_param: str = Cookie(),
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
- some_query_param: str | None = Query(default=None),
37 + some_query_param: Annotated[str | None, Query()] = None,
38 | some_body_param: str = Body("foo"),
39 | some_header_param: int = Header(default=5),
40 | ):
note: This is an unsafe fix and may change runtime behavior
33 34 | some_cookie_param: str = Cookie(),
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
36 |- some_query_param: str | None = Query(default=None),
37 |+ some_query_param: Annotated[str | None, Query()] = None,
37 38 | some_body_param: str = Body("foo"),
38 39 | some_header_param: int = Header(default=5),
39 40 | ):
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:37:5
@@ -215,23 +222,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
39 | ):
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
- some_body_param: str = Body("foo"),
38 + some_body_param: Annotated[str, Body()] = "foo",
39 | some_header_param: int = Header(default=5),
40 | ):
41 | # do stuff
note: This is an unsafe fix and may change runtime behavior
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
37 |- some_body_param: str = Body("foo"),
38 |+ some_body_param: Annotated[str, Body()] = "foo",
38 39 | some_header_param: int = Header(default=5),
39 40 | ):
40 41 | # do stuff
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:38:5
@@ -244,23 +252,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
40 | # do stuff
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
38 | some_body_param: str = Body("foo"),
- some_header_param: int = Header(default=5),
39 + some_header_param: Annotated[int, Header()] = 5,
40 | ):
41 | # do stuff
42 | pass
note: This is an unsafe fix and may change runtime behavior
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
37 38 | some_body_param: str = Body("foo"),
38 |- some_header_param: int = Header(default=5),
39 |+ some_header_param: Annotated[int, Header()] = 5,
39 40 | ):
40 41 | # do stuff
41 42 | pass
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:47:5
@@ -273,23 +282,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
49 | pass
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
45 | def get_users(
46 | skip: int,
47 | limit: int,
- current_user: User = Depends(get_current_user),
48 + current_user: Annotated[User, Depends(get_current_user)],
49 | ):
50 | pass
51 |
note: This is an unsafe fix and may change runtime behavior
44 45 | def get_users(
45 46 | skip: int,
46 47 | limit: int,
47 |- current_user: User = Depends(get_current_user),
48 |+ current_user: Annotated[User, Depends(get_current_user)],
48 49 | ):
49 50 | pass
50 51 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:53:5
@@ -302,23 +312,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
55 | limit: int = 10,
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
51 |
52 | @app.get("/users/")
53 | def get_users(
- current_user: User = Depends(get_current_user),
54 + current_user: Annotated[User, Depends(get_current_user)],
55 | skip: int = 0,
56 | limit: int = 10,
57 | ):
note: This is an unsafe fix and may change runtime behavior
50 51 |
51 52 | @app.get("/users/")
52 53 | def get_users(
53 |- current_user: User = Depends(get_current_user),
54 |+ current_user: Annotated[User, Depends(get_current_user)],
54 55 | skip: int = 0,
55 56 | limit: int = 10,
56 57 | ):
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:61:25
@@ -329,23 +340,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
62 | pass
|
help: Replace with `typing.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
59 |
60 |
61 | @app.get("/items/{item_id}")
- async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
62 + async def read_items(*, item_id: Annotated[int, Path(title="The ID of the item to get")], q: str):
63 | pass
64 |
65 | # Non fixable errors
note: This is an unsafe fix and may change runtime behavior
58 59 |
59 60 |
60 61 | @app.get("/items/{item_id}")
61 |-async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
62 |+async def read_items(*, item_id: Annotated[int, Path(title="The ID of the item to get")], q: str):
62 63 | pass
63 64 |
64 65 | # Non fixable errors
FAST002 FastAPI dependency without `Annotated`
--> FAST002_0.py:70:5

View File

@@ -12,23 +12,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
26 | ):
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
22 |
23 | @app.get("/items/")
24 | def get_items(
- current_user: User = Depends(get_current_user),
25 + current_user: Annotated[User, Depends(get_current_user)],
26 | some_security_param: str = Security(get_oauth2_user),
27 | ):
28 | pass
note: This is an unsafe fix and may change runtime behavior
21 22 |
22 23 | @app.get("/items/")
23 24 | def get_items(
24 |- current_user: User = Depends(get_current_user),
25 |+ current_user: Annotated[User, Depends(get_current_user)],
25 26 | some_security_param: str = Security(get_oauth2_user),
26 27 | ):
27 28 | pass
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:25:5
@@ -41,23 +42,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
27 | pass
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
23 | @app.get("/items/")
24 | def get_items(
25 | current_user: User = Depends(get_current_user),
- some_security_param: str = Security(get_oauth2_user),
26 + some_security_param: Annotated[str, Security(get_oauth2_user)],
27 | ):
28 | pass
29 |
note: This is an unsafe fix and may change runtime behavior
22 23 | @app.get("/items/")
23 24 | def get_items(
24 25 | current_user: User = Depends(get_current_user),
25 |- some_security_param: str = Security(get_oauth2_user),
26 |+ some_security_param: Annotated[str, Security(get_oauth2_user)],
26 27 | ):
27 28 | pass
28 29 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:32:5
@@ -70,23 +72,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
34 | some_file_param: UploadFile = File(),
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
30 |
31 | @app.post("/stuff/")
32 | def do_stuff(
- some_path_param: str = Path(),
33 + some_path_param: Annotated[str, Path()],
34 | some_cookie_param: str = Cookie(),
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
note: This is an unsafe fix and may change runtime behavior
29 30 |
30 31 | @app.post("/stuff/")
31 32 | def do_stuff(
32 |- some_path_param: str = Path(),
33 |+ some_path_param: Annotated[str, Path()],
33 34 | some_cookie_param: str = Cookie(),
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:33:5
@@ -99,23 +102,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
35 | some_form_param: str = Form(),
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
31 | @app.post("/stuff/")
32 | def do_stuff(
33 | some_path_param: str = Path(),
- some_cookie_param: str = Cookie(),
34 + some_cookie_param: Annotated[str, Cookie()],
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
note: This is an unsafe fix and may change runtime behavior
30 31 | @app.post("/stuff/")
31 32 | def do_stuff(
32 33 | some_path_param: str = Path(),
33 |- some_cookie_param: str = Cookie(),
34 |+ some_cookie_param: Annotated[str, Cookie()],
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:34:5
@@ -128,23 +132,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
36 | some_query_param: str | None = Query(default=None),
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
32 | def do_stuff(
33 | some_path_param: str = Path(),
34 | some_cookie_param: str = Cookie(),
- some_file_param: UploadFile = File(),
35 + some_file_param: Annotated[UploadFile, File()],
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
38 | some_body_param: str = Body("foo"),
note: This is an unsafe fix and may change runtime behavior
31 32 | def do_stuff(
32 33 | some_path_param: str = Path(),
33 34 | some_cookie_param: str = Cookie(),
34 |- some_file_param: UploadFile = File(),
35 |+ some_file_param: Annotated[UploadFile, File()],
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
37 38 | some_body_param: str = Body("foo"),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:35:5
@@ -157,23 +162,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
37 | some_body_param: str = Body("foo"),
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
33 | some_path_param: str = Path(),
34 | some_cookie_param: str = Cookie(),
35 | some_file_param: UploadFile = File(),
- some_form_param: str = Form(),
36 + some_form_param: Annotated[str, Form()],
37 | some_query_param: str | None = Query(default=None),
38 | some_body_param: str = Body("foo"),
39 | some_header_param: int = Header(default=5),
note: This is an unsafe fix and may change runtime behavior
32 33 | some_path_param: str = Path(),
33 34 | some_cookie_param: str = Cookie(),
34 35 | some_file_param: UploadFile = File(),
35 |- some_form_param: str = Form(),
36 |+ some_form_param: Annotated[str, Form()],
36 37 | some_query_param: str | None = Query(default=None),
37 38 | some_body_param: str = Body("foo"),
38 39 | some_header_param: int = Header(default=5),
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:36:5
@@ -186,23 +192,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
38 | some_header_param: int = Header(default=5),
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
34 | some_cookie_param: str = Cookie(),
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
- some_query_param: str | None = Query(default=None),
37 + some_query_param: Annotated[str | None, Query()] = None,
38 | some_body_param: str = Body("foo"),
39 | some_header_param: int = Header(default=5),
40 | ):
note: This is an unsafe fix and may change runtime behavior
33 34 | some_cookie_param: str = Cookie(),
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
36 |- some_query_param: str | None = Query(default=None),
37 |+ some_query_param: Annotated[str | None, Query()] = None,
37 38 | some_body_param: str = Body("foo"),
38 39 | some_header_param: int = Header(default=5),
39 40 | ):
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:37:5
@@ -215,23 +222,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
39 | ):
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
35 | some_file_param: UploadFile = File(),
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
- some_body_param: str = Body("foo"),
38 + some_body_param: Annotated[str, Body()] = "foo",
39 | some_header_param: int = Header(default=5),
40 | ):
41 | # do stuff
note: This is an unsafe fix and may change runtime behavior
34 35 | some_file_param: UploadFile = File(),
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
37 |- some_body_param: str = Body("foo"),
38 |+ some_body_param: Annotated[str, Body()] = "foo",
38 39 | some_header_param: int = Header(default=5),
39 40 | ):
40 41 | # do stuff
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:38:5
@@ -244,23 +252,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
40 | # do stuff
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
36 | some_form_param: str = Form(),
37 | some_query_param: str | None = Query(default=None),
38 | some_body_param: str = Body("foo"),
- some_header_param: int = Header(default=5),
39 + some_header_param: Annotated[int, Header()] = 5,
40 | ):
41 | # do stuff
42 | pass
note: This is an unsafe fix and may change runtime behavior
35 36 | some_form_param: str = Form(),
36 37 | some_query_param: str | None = Query(default=None),
37 38 | some_body_param: str = Body("foo"),
38 |- some_header_param: int = Header(default=5),
39 |+ some_header_param: Annotated[int, Header()] = 5,
39 40 | ):
40 41 | # do stuff
41 42 | pass
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:47:5
@@ -273,23 +282,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
49 | pass
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
45 | def get_users(
46 | skip: int,
47 | limit: int,
- current_user: User = Depends(get_current_user),
48 + current_user: Annotated[User, Depends(get_current_user)],
49 | ):
50 | pass
51 |
note: This is an unsafe fix and may change runtime behavior
44 45 | def get_users(
45 46 | skip: int,
46 47 | limit: int,
47 |- current_user: User = Depends(get_current_user),
48 |+ current_user: Annotated[User, Depends(get_current_user)],
48 49 | ):
49 50 | pass
50 51 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:53:5
@@ -302,23 +312,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
55 | limit: int = 10,
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
51 |
52 | @app.get("/users/")
53 | def get_users(
- current_user: User = Depends(get_current_user),
54 + current_user: Annotated[User, Depends(get_current_user)],
55 | skip: int = 0,
56 | limit: int = 10,
57 | ):
note: This is an unsafe fix and may change runtime behavior
50 51 |
51 52 | @app.get("/users/")
52 53 | def get_users(
53 |- current_user: User = Depends(get_current_user),
54 |+ current_user: Annotated[User, Depends(get_current_user)],
54 55 | skip: int = 0,
55 56 | limit: int = 10,
56 57 | ):
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_0.py:61:25
@@ -329,23 +340,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
62 | pass
|
help: Replace with `typing_extensions.Annotated`
12 | Security,
13 | )
14 | from pydantic import BaseModel
15 + from typing_extensions import Annotated
16 |
17 | app = FastAPI()
18 | router = APIRouter()
Unsafe fix
12 12 | Security,
13 13 | )
14 14 | from pydantic import BaseModel
15 |+from typing_extensions import Annotated
15 16 |
16 17 | app = FastAPI()
17 18 | router = APIRouter()
--------------------------------------------------------------------------------
59 |
60 |
61 | @app.get("/items/{item_id}")
- async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
62 + async def read_items(*, item_id: Annotated[int, Path(title="The ID of the item to get")], q: str):
63 | pass
64 |
65 | # Non fixable errors
note: This is an unsafe fix and may change runtime behavior
58 59 |
59 60 |
60 61 | @app.get("/items/{item_id}")
61 |-async def read_items(*, item_id: int = Path(title="The ID of the item to get"), q: str):
62 |+async def read_items(*, item_id: Annotated[int, Path(title="The ID of the item to get")], q: str):
62 63 | pass
63 64 |
64 65 | # Non fixable errors
FAST002 FastAPI dependency without `Annotated`
--> FAST002_0.py:70:5

View File

@@ -10,21 +10,22 @@ FAST002 [*] FastAPI dependency without `Annotated`
11 | return echo
|
help: Replace with `typing.Annotated`
2 | values. See #15043 for more details."""
3 |
4 | from fastapi import FastAPI, Query
5 + from typing import Annotated
6 |
7 | app = FastAPI()
8 |
9 |
10 | @app.get("/test")
- def handler(echo: str = Query("")):
11 + def handler(echo: Annotated[str, Query()] = ""):
12 | return echo
13 |
14 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 | values. See #15043 for more details."""
3 3 |
4 4 | from fastapi import FastAPI, Query
5 |+from typing import Annotated
5 6 |
6 7 | app = FastAPI()
7 8 |
8 9 |
9 10 | @app.get("/test")
10 |-def handler(echo: str = Query("")):
11 |+def handler(echo: Annotated[str, Query()] = ""):
11 12 | return echo
12 13 |
13 14 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_1.py:15:14
@@ -35,23 +36,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
16 | return echo
|
help: Replace with `typing.Annotated`
2 | values. See #15043 for more details."""
3 |
4 | from fastapi import FastAPI, Query
5 + from typing import Annotated
6 |
7 | app = FastAPI()
8 |
Unsafe fix
2 2 | values. See #15043 for more details."""
3 3 |
4 4 | from fastapi import FastAPI, Query
5 |+from typing import Annotated
5 6 |
6 7 | app = FastAPI()
7 8 |
--------------------------------------------------------------------------------
13 |
14 |
15 | @app.get("/test")
- def handler2(echo: str = Query(default="")):
16 + def handler2(echo: Annotated[str, Query()] = ""):
17 | return echo
18 |
19 |
note: This is an unsafe fix and may change runtime behavior
12 13 |
13 14 |
14 15 | @app.get("/test")
15 |-def handler2(echo: str = Query(default="")):
16 |+def handler2(echo: Annotated[str, Query()] = ""):
16 17 | return echo
17 18 |
18 19 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_1.py:20:14
@@ -62,18 +64,19 @@ FAST002 [*] FastAPI dependency without `Annotated`
21 | return echo
|
help: Replace with `typing.Annotated`
2 | values. See #15043 for more details."""
3 |
4 | from fastapi import FastAPI, Query
5 + from typing import Annotated
6 |
7 | app = FastAPI()
8 |
Unsafe fix
2 2 | values. See #15043 for more details."""
3 3 |
4 4 | from fastapi import FastAPI, Query
5 |+from typing import Annotated
5 6 |
6 7 | app = FastAPI()
7 8 |
--------------------------------------------------------------------------------
18 |
19 |
20 | @app.get("/test")
- def handler3(echo: str = Query("123", min_length=3, max_length=50)):
21 + def handler3(echo: Annotated[str, Query(min_length=3, max_length=50)] = "123"):
22 | return echo
note: This is an unsafe fix and may change runtime behavior
17 18 |
18 19 |
19 20 | @app.get("/test")
20 |-def handler3(echo: str = Query("123", min_length=3, max_length=50)):
21 |+def handler3(echo: Annotated[str, Query(min_length=3, max_length=50)] = "123"):
21 22 | return echo

View File

@@ -10,21 +10,22 @@ FAST002 [*] FastAPI dependency without `Annotated`
11 | return echo
|
help: Replace with `typing_extensions.Annotated`
2 | values. See #15043 for more details."""
3 |
4 | from fastapi import FastAPI, Query
5 + from typing_extensions import Annotated
6 |
7 | app = FastAPI()
8 |
9 |
10 | @app.get("/test")
- def handler(echo: str = Query("")):
11 + def handler(echo: Annotated[str, Query()] = ""):
12 | return echo
13 |
14 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 | values. See #15043 for more details."""
3 3 |
4 4 | from fastapi import FastAPI, Query
5 |+from typing_extensions import Annotated
5 6 |
6 7 | app = FastAPI()
7 8 |
8 9 |
9 10 | @app.get("/test")
10 |-def handler(echo: str = Query("")):
11 |+def handler(echo: Annotated[str, Query()] = ""):
11 12 | return echo
12 13 |
13 14 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_1.py:15:14
@@ -35,23 +36,24 @@ FAST002 [*] FastAPI dependency without `Annotated`
16 | return echo
|
help: Replace with `typing_extensions.Annotated`
2 | values. See #15043 for more details."""
3 |
4 | from fastapi import FastAPI, Query
5 + from typing_extensions import Annotated
6 |
7 | app = FastAPI()
8 |
Unsafe fix
2 2 | values. See #15043 for more details."""
3 3 |
4 4 | from fastapi import FastAPI, Query
5 |+from typing_extensions import Annotated
5 6 |
6 7 | app = FastAPI()
7 8 |
--------------------------------------------------------------------------------
13 |
14 |
15 | @app.get("/test")
- def handler2(echo: str = Query(default="")):
16 + def handler2(echo: Annotated[str, Query()] = ""):
17 | return echo
18 |
19 |
note: This is an unsafe fix and may change runtime behavior
12 13 |
13 14 |
14 15 | @app.get("/test")
15 |-def handler2(echo: str = Query(default="")):
16 |+def handler2(echo: Annotated[str, Query()] = ""):
16 17 | return echo
17 18 |
18 19 |
FAST002 [*] FastAPI dependency without `Annotated`
--> FAST002_1.py:20:14
@@ -62,18 +64,19 @@ FAST002 [*] FastAPI dependency without `Annotated`
21 | return echo
|
help: Replace with `typing_extensions.Annotated`
2 | values. See #15043 for more details."""
3 |
4 | from fastapi import FastAPI, Query
5 + from typing_extensions import Annotated
6 |
7 | app = FastAPI()
8 |
Unsafe fix
2 2 | values. See #15043 for more details."""
3 3 |
4 4 | from fastapi import FastAPI, Query
5 |+from typing_extensions import Annotated
5 6 |
6 7 | app = FastAPI()
7 8 |
--------------------------------------------------------------------------------
18 |
19 |
20 | @app.get("/test")
- def handler3(echo: str = Query("123", min_length=3, max_length=50)):
21 + def handler3(echo: Annotated[str, Query(min_length=3, max_length=50)] = "123"):
22 | return echo
note: This is an unsafe fix and may change runtime behavior
17 18 |
18 19 |
19 20 | @app.get("/test")
20 |-def handler3(echo: str = Query("123", min_length=3, max_length=50)):
21 |+def handler3(echo: Annotated[str, Query(min_length=3, max_length=50)] = "123"):
21 22 | return echo

View File

@@ -10,15 +10,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
19 | return item
|
help: Remove argument
14 | # Errors
15 |
16 |
- @app.post("/items/", response_model=Item)
17 + @app.post("/items/")
18 | async def create_item(item: Item) -> Item:
19 | return item
20 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
14 14 | # Errors
15 15 |
16 16 |
17 |-@app.post("/items/", response_model=Item)
17 |+@app.post("/items/")
18 18 | async def create_item(item: Item) -> Item:
19 19 | return item
20 20 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:22:22
@@ -29,15 +30,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
24 | return item
|
help: Remove argument
19 | return item
20 |
21 |
- @app.post("/items/", response_model=list[Item])
22 + @app.post("/items/")
23 | async def create_item(item: Item) -> list[Item]:
24 | return item
25 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
19 19 | return item
20 20 |
21 21 |
22 |-@app.post("/items/", response_model=list[Item])
22 |+@app.post("/items/")
23 23 | async def create_item(item: Item) -> list[Item]:
24 24 | return item
25 25 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:27:22
@@ -48,15 +50,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
29 | return item
|
help: Remove argument
24 | return item
25 |
26 |
- @app.post("/items/", response_model=List[Item])
27 + @app.post("/items/")
28 | async def create_item(item: Item) -> List[Item]:
29 | return item
30 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
24 24 | return item
25 25 |
26 26 |
27 |-@app.post("/items/", response_model=List[Item])
27 |+@app.post("/items/")
28 28 | async def create_item(item: Item) -> List[Item]:
29 29 | return item
30 30 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:32:22
@@ -67,15 +70,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
34 | return item
|
help: Remove argument
29 | return item
30 |
31 |
- @app.post("/items/", response_model=Dict[str, Item])
32 + @app.post("/items/")
33 | async def create_item(item: Item) -> Dict[str, Item]:
34 | return item
35 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
29 29 | return item
30 30 |
31 31 |
32 |-@app.post("/items/", response_model=Dict[str, Item])
32 |+@app.post("/items/")
33 33 | async def create_item(item: Item) -> Dict[str, Item]:
34 34 | return item
35 35 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:37:22
@@ -86,15 +90,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
39 | return item
|
help: Remove argument
34 | return item
35 |
36 |
- @app.post("/items/", response_model=str)
37 + @app.post("/items/")
38 | async def create_item(item: Item) -> str:
39 | return item
40 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
34 34 | return item
35 35 |
36 36 |
37 |-@app.post("/items/", response_model=str)
37 |+@app.post("/items/")
38 38 | async def create_item(item: Item) -> str:
39 39 | return item
40 40 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:42:21
@@ -105,15 +110,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
44 | return item
|
help: Remove argument
39 | return item
40 |
41 |
- @app.get("/items/", response_model=Item)
42 + @app.get("/items/")
43 | async def create_item(item: Item) -> Item:
44 | return item
45 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
39 39 | return item
40 40 |
41 41 |
42 |-@app.get("/items/", response_model=Item)
42 |+@app.get("/items/")
43 43 | async def create_item(item: Item) -> Item:
44 44 | return item
45 45 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:47:21
@@ -124,15 +130,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
49 | async def create_item(item: Item) -> Item:
|
help: Remove argument
44 | return item
45 |
46 |
- @app.get("/items/", response_model=Item)
47 + @app.get("/items/")
48 | @app.post("/items/", response_model=Item)
49 | async def create_item(item: Item) -> Item:
50 | return item
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
44 44 | return item
45 45 |
46 46 |
47 |-@app.get("/items/", response_model=Item)
47 |+@app.get("/items/")
48 48 | @app.post("/items/", response_model=Item)
49 49 | async def create_item(item: Item) -> Item:
50 50 | return item
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:48:22
@@ -144,15 +151,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
50 | return item
|
help: Remove argument
45 |
46 |
47 | @app.get("/items/", response_model=Item)
- @app.post("/items/", response_model=Item)
48 + @app.post("/items/")
49 | async def create_item(item: Item) -> Item:
50 | return item
51 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
45 45 |
46 46 |
47 47 | @app.get("/items/", response_model=Item)
48 |-@app.post("/items/", response_model=Item)
48 |+@app.post("/items/")
49 49 | async def create_item(item: Item) -> Item:
50 50 | return item
51 51 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:53:24
@@ -163,15 +171,16 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
55 | return item
|
help: Remove argument
50 | return item
51 |
52 |
- @router.get("/items/", response_model=Item)
53 + @router.get("/items/")
54 | async def create_item(item: Item) -> Item:
55 | return item
56 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
50 50 | return item
51 51 |
52 52 |
53 |-@router.get("/items/", response_model=Item)
53 |+@router.get("/items/")
54 54 | async def create_item(item: Item) -> Item:
55 55 | return item
56 56 |
FAST001 [*] FastAPI route with redundant `response_model` argument
--> FAST001.py:118:23
@@ -184,12 +193,13 @@ FAST001 [*] FastAPI route with redundant `response_model` argument
120 | return "Hello World!"
|
help: Remove argument
115 |
116 | def setup_app(app_arg: FastAPI, non_app: str) -> None:
117 | # Error
- @app_arg.get("/", response_model=str)
118 + @app_arg.get("/")
119 | async def get_root() -> str:
120 | return "Hello World!"
121 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
115 115 |
116 116 | def setup_app(app_arg: FastAPI, non_app: str) -> None:
117 117 | # Error
118 |- @app_arg.get("/", response_model=str)
118 |+ @app_arg.get("/")
119 119 | async def get_root() -> str:
120 120 | return "Hello World!"
121 121 |

View File

@@ -11,15 +11,16 @@ FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing`
11 | return {"query": query}
|
help: Add `thing_id` to function signature
7 |
8 | # Errors
9 | @app.get("/things/{thing_id}")
- async def read_thing(query: str):
10 + async def read_thing(query: str, thing_id):
11 | return {"query": query}
12 |
13 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
7 7 |
8 8 | # Errors
9 9 | @app.get("/things/{thing_id}")
10 |-async def read_thing(query: str):
10 |+async def read_thing(query: str, thing_id):
11 11 | return {"query": query}
12 12 |
13 13 |
FAST003 [*] Parameter `isbn` appears in route path, but not in `read_thing` signature
--> FAST003.py:14:23
@@ -30,15 +31,16 @@ FAST003 [*] Parameter `isbn` appears in route path, but not in `read_thing` sign
16 | ...
|
help: Add `isbn` to function signature
12 |
13 |
14 | @app.get("/books/isbn-{isbn}")
- async def read_thing():
15 + async def read_thing(isbn):
16 | ...
17 |
18 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
12 12 |
13 13 |
14 14 | @app.get("/books/isbn-{isbn}")
15 |-async def read_thing():
15 |+async def read_thing(isbn):
16 16 | ...
17 17 |
18 18 |
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
--> FAST003.py:19:19
@@ -49,15 +51,36 @@ FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing`
21 | return {"query": query}
|
help: Add `thing_id` to function signature
17 |
18 |
19 | @app.get("/things/{thing_id:path}")
- async def read_thing(query: str):
20 + async def read_thing(query: str, thing_id):
21 | return {"query": query}
22 |
23 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
17 17 |
18 18 |
19 19 | @app.get("/things/{thing_id:path}")
20 |-async def read_thing(query: str):
20 |+async def read_thing(query: str, thing_id):
21 21 | return {"query": query}
22 22 |
23 23 |
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}")
| ^^^^^^^^^^^^^^^^^
25 | async def read_thing(query: str):
26 | return {"query": query}
|
help: Add `thing_id` to function signature
Unsafe fix
22 22 |
23 23 |
24 24 | @app.get("/things/{thing_id : path}")
25 |-async def read_thing(query: str):
25 |+async def read_thing(query: str, thing_id):
26 26 | return {"query": query}
27 27 |
28 28 |
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
--> FAST003.py:29:27
@@ -68,15 +91,16 @@ FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` sig
31 | return {"author": author}
|
help: Add `title` to function signature
27 |
28 |
29 | @app.get("/books/{author}/{title}")
- async def read_thing(author: str):
30 + async def read_thing(author: str, title):
31 | return {"author": author}
32 |
33 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
27 27 |
28 28 |
29 29 | @app.get("/books/{author}/{title}")
30 |-async def read_thing(author: str):
30 |+async def read_thing(author: str, title):
31 31 | return {"author": author}
32 32 |
33 33 |
FAST003 [*] Parameter `author_name` appears in route path, but not in `read_thing` signature
--> FAST003.py:34:18
@@ -87,15 +111,16 @@ FAST003 [*] Parameter `author_name` appears in route path, but not in `read_thin
36 | ...
|
help: Add `author_name` to function signature
32 |
33 |
34 | @app.get("/books/{author_name}/{title}")
- async def read_thing():
35 + async def read_thing(author_name):
36 | ...
37 |
38 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
32 32 |
33 33 |
34 34 | @app.get("/books/{author_name}/{title}")
35 |-async def read_thing():
35 |+async def read_thing(author_name):
36 36 | ...
37 37 |
38 38 |
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
--> FAST003.py:34:32
@@ -106,15 +131,16 @@ FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` sig
36 | ...
|
help: Add `title` to function signature
32 |
33 |
34 | @app.get("/books/{author_name}/{title}")
- async def read_thing():
35 + async def read_thing(title):
36 | ...
37 |
38 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
32 32 |
33 33 |
34 34 | @app.get("/books/{author_name}/{title}")
35 |-async def read_thing():
35 |+async def read_thing(title):
36 36 | ...
37 37 |
38 38 |
FAST003 Parameter `author` appears in route path, but only as a positional-only argument in `read_thing` signature
--> FAST003.py:39:18
@@ -143,15 +169,16 @@ FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` sig
46 | author: str,
|
help: Add `title` to function signature
44 | @app.get("/books/{author}/{title}/{page}")
45 | async def read_thing(
46 | author: str,
- query: str,
47 + query: str, title,
48 | ): ...
49 |
50 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
44 44 | @app.get("/books/{author}/{title}/{page}")
45 45 | async def read_thing(
46 46 | author: str,
47 |- query: str,
47 |+ query: str, title,
48 48 | ): ...
49 49 |
50 50 |
FAST003 [*] Parameter `page` appears in route path, but not in `read_thing` signature
--> FAST003.py:44:35
@@ -162,15 +189,16 @@ FAST003 [*] Parameter `page` appears in route path, but not in `read_thing` sign
46 | author: str,
|
help: Add `page` to function signature
44 | @app.get("/books/{author}/{title}/{page}")
45 | async def read_thing(
46 | author: str,
- query: str,
47 + query: str, page,
48 | ): ...
49 |
50 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
44 44 | @app.get("/books/{author}/{title}/{page}")
45 45 | async def read_thing(
46 46 | author: str,
47 |- query: str,
47 |+ query: str, page,
48 48 | ): ...
49 49 |
50 50 |
FAST003 [*] Parameter `author` appears in route path, but not in `read_thing` signature
--> FAST003.py:51:18
@@ -181,15 +209,16 @@ FAST003 [*] Parameter `author` appears in route path, but not in `read_thing` si
53 | ...
|
help: Add `author` to function signature
49 |
50 |
51 | @app.get("/books/{author}/{title}")
- async def read_thing():
52 + async def read_thing(author):
53 | ...
54 |
55 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
49 49 |
50 50 |
51 51 | @app.get("/books/{author}/{title}")
52 |-async def read_thing():
52 |+async def read_thing(author):
53 53 | ...
54 54 |
55 55 |
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
--> FAST003.py:51:27
@@ -200,15 +229,16 @@ FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` sig
53 | ...
|
help: Add `title` to function signature
49 |
50 |
51 | @app.get("/books/{author}/{title}")
- async def read_thing():
52 + async def read_thing(title):
53 | ...
54 |
55 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
49 49 |
50 50 |
51 51 | @app.get("/books/{author}/{title}")
52 |-async def read_thing():
52 |+async def read_thing(title):
53 53 | ...
54 54 |
55 55 |
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
--> FAST003.py:56:27
@@ -219,15 +249,16 @@ FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` sig
58 | ...
|
help: Add `title` to function signature
54 |
55 |
56 | @app.get("/books/{author}/{title}")
- async def read_thing(*, author: str):
57 + async def read_thing(title, *, author: str):
58 | ...
59 |
60 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
54 54 |
55 55 |
56 56 | @app.get("/books/{author}/{title}")
57 |-async def read_thing(*, author: str):
57 |+async def read_thing(title, *, author: str):
58 58 | ...
59 59 |
60 60 |
FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` signature
--> FAST003.py:61:27
@@ -238,15 +269,16 @@ FAST003 [*] Parameter `title` appears in route path, but not in `read_thing` sig
63 | ...
|
help: Add `title` to function signature
59 |
60 |
61 | @app.get("/books/{author}/{title}")
- async def read_thing(hello, /, *, author: str):
62 + async def read_thing(hello, /, title, *, author: str):
63 | ...
64 |
65 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
59 59 |
60 60 |
61 61 | @app.get("/books/{author}/{title}")
62 |-async def read_thing(hello, /, *, author: str):
62 |+async def read_thing(hello, /, title, *, author: str):
63 63 | ...
64 64 |
65 65 |
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
--> FAST003.py:66:19
@@ -257,15 +289,16 @@ FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing`
68 | query: str,
|
help: Add `thing_id` to function signature
65 |
66 | @app.get("/things/{thing_id}")
67 | async def read_thing(
- query: str,
68 + query: str, thing_id,
69 | ):
70 | return {"query": query}
71 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
65 65 |
66 66 | @app.get("/things/{thing_id}")
67 67 | async def read_thing(
68 |- query: str,
68 |+ query: str, thing_id,
69 69 | ):
70 70 | return {"query": query}
71 71 |
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
--> FAST003.py:73:19
@@ -276,15 +309,16 @@ FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing`
75 | query: str = "default",
|
help: Add `thing_id` to function signature
72 |
73 | @app.get("/things/{thing_id}")
74 | async def read_thing(
- query: str = "default",
75 + thing_id, query: str = "default",
76 | ):
77 | return {"query": query}
78 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
72 72 |
73 73 | @app.get("/things/{thing_id}")
74 74 | async def read_thing(
75 |- query: str = "default",
75 |+ thing_id, query: str = "default",
76 76 | ):
77 77 | return {"query": query}
78 78 |
FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing` signature
--> FAST003.py:80:19
@@ -295,15 +329,16 @@ FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing`
82 | *, query: str = "default",
|
help: Add `thing_id` to function signature
79 |
80 | @app.get("/things/{thing_id}")
81 | async def read_thing(
- *, query: str = "default",
82 + thing_id, *, query: str = "default",
83 | ):
84 | return {"query": query}
85 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
79 79 |
80 80 | @app.get("/things/{thing_id}")
81 81 | async def read_thing(
82 |- *, query: str = "default",
82 |+ thing_id, *, query: str = "default",
83 83 | ):
84 84 | return {"query": query}
85 85 |
FAST003 [*] Parameter `name` appears in route path, but not in `read_thing` signature
--> FAST003.py:87:18
@@ -314,15 +349,16 @@ FAST003 [*] Parameter `name` appears in route path, but not in `read_thing` sign
89 | return {"author": author, "title": title}
|
help: Add `name` to function signature
85 |
86 |
87 | @app.get("/books/{name}/{title}")
- async def read_thing(*, author: Annotated[str, Path(alias="author_name")], title: str):
88 + async def read_thing(name, *, author: Annotated[str, Path(alias="author_name")], title: str):
89 | return {"author": author, "title": title}
90 |
91 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
85 85 |
86 86 |
87 87 | @app.get("/books/{name}/{title}")
88 |-async def read_thing(*, author: Annotated[str, Path(alias="author_name")], title: str):
88 |+async def read_thing(name, *, author: Annotated[str, Path(alias="author_name")], title: str):
89 89 | return {"author": author, "title": title}
90 90 |
91 91 |
FAST003 [*] Parameter `thing_id` appears in route path, but not in `single` signature
--> FAST003.py:158:19
@@ -334,15 +370,16 @@ FAST003 [*] Parameter `thing_id` appears in route path, but not in `single` sign
160 | @app.get("/things/{thing_id}")
|
help: Add `thing_id` to function signature
156 |
157 | ### Errors
158 | @app.get("/things/{thing_id}")
- async def single(other: Annotated[str, Depends(something_else)]): ...
159 + async def single(other: Annotated[str, Depends(something_else)], thing_id): ...
160 | @app.get("/things/{thing_id}")
161 | async def default(other: str = Depends(something_else)): ...
162 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
156 156 |
157 157 | ### Errors
158 158 | @app.get("/things/{thing_id}")
159 |-async def single(other: Annotated[str, Depends(something_else)]): ...
159 |+async def single(other: Annotated[str, Depends(something_else)], thing_id): ...
160 160 | @app.get("/things/{thing_id}")
161 161 | async def default(other: str = Depends(something_else)): ...
162 162 |
FAST003 [*] Parameter `thing_id` appears in route path, but not in `default` signature
--> FAST003.py:160:19
@@ -354,15 +391,16 @@ FAST003 [*] Parameter `thing_id` appears in route path, but not in `default` sig
161 | async def default(other: str = Depends(something_else)): ...
|
help: Add `thing_id` to function signature
158 | @app.get("/things/{thing_id}")
159 | async def single(other: Annotated[str, Depends(something_else)]): ...
160 | @app.get("/things/{thing_id}")
- async def default(other: str = Depends(something_else)): ...
161 + async def default(thing_id, other: str = Depends(something_else)): ...
162 |
163 |
164 | ### No errors
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
158 158 | @app.get("/things/{thing_id}")
159 159 | async def single(other: Annotated[str, Depends(something_else)]): ...
160 160 | @app.get("/things/{thing_id}")
161 |-async def default(other: str = Depends(something_else)): ...
161 |+async def default(thing_id, other: str = Depends(something_else)): ...
162 162 |
163 163 |
164 164 | ### No errors
FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_full` signature
--> FAST003.py:197:12
@@ -374,15 +412,16 @@ FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_fu
199 | params: Annotated[PydanticParams, Depends(PydanticParams)],
|
help: Add `id` to function signature
196 | # Errors
197 | @app.get("/{id}")
198 | async def get_id_pydantic_full(
- params: Annotated[PydanticParams, Depends(PydanticParams)],
199 + params: Annotated[PydanticParams, Depends(PydanticParams)], id,
200 | ): ...
201 | @app.get("/{id}")
202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
196 196 | # Errors
197 197 | @app.get("/{id}")
198 198 | async def get_id_pydantic_full(
199 |- params: Annotated[PydanticParams, Depends(PydanticParams)],
199 |+ params: Annotated[PydanticParams, Depends(PydanticParams)], id,
200 200 | ): ...
201 201 | @app.get("/{id}")
202 202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_short` signature
--> FAST003.py:201:12
@@ -395,15 +434,16 @@ FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_sh
203 | @app.get("/{id}")
|
help: Add `id` to function signature
199 | params: Annotated[PydanticParams, Depends(PydanticParams)],
200 | ): ...
201 | @app.get("/{id}")
- async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
202 + async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()], id): ...
203 | @app.get("/{id}")
204 | async def get_id_init_not_annotated(params = Depends(InitParams)): ...
205 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
199 199 | params: Annotated[PydanticParams, Depends(PydanticParams)],
200 200 | ): ...
201 201 | @app.get("/{id}")
202 |-async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
202 |+async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()], id): ...
203 203 | @app.get("/{id}")
204 204 | async def get_id_init_not_annotated(params = Depends(InitParams)): ...
205 205 |
FAST003 [*] Parameter `id` appears in route path, but not in `get_id_init_not_annotated` signature
--> FAST003.py:203:12
@@ -415,12 +455,13 @@ FAST003 [*] Parameter `id` appears in route path, but not in `get_id_init_not_an
204 | async def get_id_init_not_annotated(params = Depends(InitParams)): ...
|
help: Add `id` to function signature
201 | @app.get("/{id}")
202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
203 | @app.get("/{id}")
- async def get_id_init_not_annotated(params = Depends(InitParams)): ...
204 + async def get_id_init_not_annotated(id, params = Depends(InitParams)): ...
205 |
206 |
207 | # No errors
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
201 201 | @app.get("/{id}")
202 202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
203 203 | @app.get("/{id}")
204 |-async def get_id_init_not_annotated(params = Depends(InitParams)): ...
204 |+async def get_id_init_not_annotated(id, params = Depends(InitParams)): ...
205 205 |
206 206 |
207 207 | # No errors

View File

@@ -9,12 +9,13 @@ ANN201 [*] Missing return type annotation for public function `func`
2 | return 1
|
help: Add return type annotation: `int`
- def func():
1 + def func() -> int:
2 | return 1
3 |
4 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
1 |-def func():
1 |+def func() -> int:
2 2 | return 1
3 3 |
4 4 |
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:5:5
@@ -24,15 +25,16 @@ ANN201 [*] Missing return type annotation for public function `func`
6 | return 1.5
|
help: Add return type annotation: `float`
2 | return 1
3 |
4 |
- def func():
5 + def func() -> float:
6 | return 1.5
7 |
8 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 | return 1
3 3 |
4 4 |
5 |-def func():
5 |+def func() -> float:
6 6 | return 1.5
7 7 |
8 8 |
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:9:5
@@ -43,15 +45,16 @@ ANN201 [*] Missing return type annotation for public function `func`
11 | return 1
|
help: Add return type annotation: `float`
6 | return 1.5
7 |
8 |
- def func(x: int):
9 + def func(x: int) -> float:
10 | if x > 0:
11 | return 1
12 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
6 6 | return 1.5
7 7 |
8 8 |
9 |-def func(x: int):
9 |+def func(x: int) -> float:
10 10 | if x > 0:
11 11 | return 1
12 12 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:16:5
@@ -61,15 +64,16 @@ ANN201 [*] Missing return type annotation for public function `func`
17 | return True
|
help: Add return type annotation: `bool`
13 | return 1.5
14 |
15 |
- def func():
16 + def func() -> bool:
17 | return True
18 |
19 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
13 13 | return 1.5
14 14 |
15 15 |
16 |-def func():
16 |+def func() -> bool:
17 17 | return True
18 18 |
19 19 |
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:20:5
@@ -80,15 +84,16 @@ ANN201 [*] Missing return type annotation for public function `func`
22 | return None
|
help: Add return type annotation: `None`
17 | return True
18 |
19 |
- def func(x: int):
20 + def func(x: int) -> None:
21 | if x > 0:
22 | return None
23 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
17 17 | return True
18 18 |
19 19 |
20 |-def func(x: int):
20 |+def func(x: int) -> None:
21 21 | if x > 0:
22 22 | return None
23 23 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:27:5
@@ -98,15 +103,16 @@ ANN201 [*] Missing return type annotation for public function `func`
28 | return 1 or 2.5 if x > 0 else 1.5 or "str"
|
help: Add return type annotation: `str | float`
24 | return
25 |
26 |
- def func(x: int):
27 + def func(x: int) -> str | float:
28 | return 1 or 2.5 if x > 0 else 1.5 or "str"
29 |
30 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
24 24 | return
25 25 |
26 26 |
27 |-def func(x: int):
27 |+def func(x: int) -> str | float:
28 28 | return 1 or 2.5 if x > 0 else 1.5 or "str"
29 29 |
30 30 |
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:31:5
@@ -116,15 +122,16 @@ ANN201 [*] Missing return type annotation for public function `func`
32 | return 1 + 2.5 if x > 0 else 1.5 or "str"
|
help: Add return type annotation: `str | float`
28 | return 1 or 2.5 if x > 0 else 1.5 or "str"
29 |
30 |
- def func(x: int):
31 + def func(x: int) -> str | float:
32 | return 1 + 2.5 if x > 0 else 1.5 or "str"
33 |
34 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
28 28 | return 1 or 2.5 if x > 0 else 1.5 or "str"
29 29 |
30 30 |
31 |-def func(x: int):
31 |+def func(x: int) -> str | float:
32 32 | return 1 + 2.5 if x > 0 else 1.5 or "str"
33 33 |
34 34 |
ANN201 Missing return type annotation for public function `func`
--> auto_return_type.py:35:5
@@ -154,15 +161,16 @@ ANN201 [*] Missing return type annotation for public function `func`
47 | return 1
|
help: Add return type annotation: `int`
42 | return {"foo": 1}
43 |
44 |
- def func(x: int):
45 + def func(x: int) -> int:
46 | if not x:
47 | return 1
48 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
42 42 | return {"foo": 1}
43 43 |
44 44 |
45 |-def func(x: int):
45 |+def func(x: int) -> int:
46 46 | if not x:
47 47 | return 1
48 48 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:52:5
@@ -173,15 +181,16 @@ ANN201 [*] Missing return type annotation for public function `func`
54 | return 1
|
help: Add return type annotation: `int | None`
49 | return True
50 |
51 |
- def func(x: int):
52 + def func(x: int) -> int | None:
53 | if not x:
54 | return 1
55 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
49 49 | return True
50 50 |
51 51 |
52 |-def func(x: int):
52 |+def func(x: int) -> int | None:
53 53 | if not x:
54 54 | return 1
55 55 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:59:5
@@ -192,15 +201,16 @@ ANN201 [*] Missing return type annotation for public function `func`
61 | return 1
|
help: Add return type annotation: `str | int | None`
56 | return None
57 |
58 |
- def func(x: int):
59 + def func(x: int) -> str | int | None:
60 | if not x:
61 | return 1
62 | elif x > 5:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
56 56 | return None
57 57 |
58 58 |
59 |-def func(x: int):
59 |+def func(x: int) -> str | int | None:
60 60 | if not x:
61 61 | return 1
62 62 | elif x > 5:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:68:5
@@ -211,15 +221,16 @@ ANN201 [*] Missing return type annotation for public function `func`
70 | return 1
|
help: Add return type annotation: `int | None`
65 | return None
66 |
67 |
- def func(x: int):
68 + def func(x: int) -> int | None:
69 | if x:
70 | return 1
71 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
65 65 | return None
66 66 |
67 67 |
68 |-def func(x: int):
68 |+def func(x: int) -> int | None:
69 69 | if x:
70 70 | return 1
71 71 |
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:73:5
@@ -229,15 +240,16 @@ ANN201 [*] Missing return type annotation for public function `func`
74 | x = 1
|
help: Add return type annotation: `None`
70 | return 1
71 |
72 |
- def func():
73 + def func() -> None:
74 | x = 1
75 |
76 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
70 70 | return 1
71 71 |
72 72 |
73 |-def func():
73 |+def func() -> None:
74 74 | x = 1
75 75 |
76 76 |
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:77:5
@@ -248,15 +260,16 @@ ANN201 [*] Missing return type annotation for public function `func`
79 | return 1
|
help: Add return type annotation: `int | None`
74 | x = 1
75 |
76 |
- def func(x: int):
77 + def func(x: int) -> int | None:
78 | if x > 0:
79 | return 1
80 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
74 74 | x = 1
75 75 |
76 76 |
77 |-def func(x: int):
77 |+def func(x: int) -> int | None:
78 78 | if x > 0:
79 79 | return 1
80 80 |
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:82:5
@@ -267,15 +280,16 @@ ANN201 [*] Missing return type annotation for public function `func`
84 | case [1, 2, 3]:
|
help: Add return type annotation: `str | int | None`
79 | return 1
80 |
81 |
- def func(x: int):
82 + def func(x: int) -> str | int | None:
83 | match x:
84 | case [1, 2, 3]:
85 | return 1
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
79 79 | return 1
80 80 |
81 81 |
82 |-def func(x: int):
82 |+def func(x: int) -> str | int | None:
83 83 | match x:
84 84 | case [1, 2, 3]:
85 85 | return 1
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:90:5
@@ -286,15 +300,16 @@ ANN201 [*] Missing return type annotation for public function `func`
92 | if i > 0:
|
help: Add return type annotation: `int | None`
87 | return "foo"
88 |
89 |
- def func(x: int):
90 + def func(x: int) -> int | None:
91 | for i in range(5):
92 | if i > 0:
93 | return 1
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
87 87 | return "foo"
88 88 |
89 89 |
90 |-def func(x: int):
90 |+def func(x: int) -> int | None:
91 91 | for i in range(5):
92 92 | if i > 0:
93 93 | return 1
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:96:5
@@ -305,15 +320,16 @@ ANN201 [*] Missing return type annotation for public function `func`
98 | if i > 0:
|
help: Add return type annotation: `int`
93 | return 1
94 |
95 |
- def func(x: int):
96 + def func(x: int) -> int:
97 | for i in range(5):
98 | if i > 0:
99 | return 1
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
93 93 | return 1
94 94 |
95 95 |
96 |-def func(x: int):
96 |+def func(x: int) -> int:
97 97 | for i in range(5):
98 98 | if i > 0:
99 99 | return 1
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:104:5
@@ -324,15 +340,16 @@ ANN201 [*] Missing return type annotation for public function `func`
106 | if i > 0:
|
help: Add return type annotation: `int | None`
101 | return 4
102 |
103 |
- def func(x: int):
104 + def func(x: int) -> int | None:
105 | for i in range(5):
106 | if i > 0:
107 | break
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
101 101 | return 4
102 102 |
103 103 |
104 |-def func(x: int):
104 |+def func(x: int) -> int | None:
105 105 | for i in range(5):
106 106 | if i > 0:
107 107 | break
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:112:5
@@ -343,15 +360,16 @@ ANN201 [*] Missing return type annotation for public function `func`
114 | pass
|
help: Add return type annotation: `int | None`
109 | return 4
110 |
111 |
- def func(x: int):
112 + def func(x: int) -> int | None:
113 | try:
114 | pass
115 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
109 109 | return 4
110 110 |
111 111 |
112 |-def func(x: int):
112 |+def func(x: int) -> int | None:
113 113 | try:
114 114 | pass
115 115 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:119:5
@@ -362,15 +380,16 @@ ANN201 [*] Missing return type annotation for public function `func`
121 | pass
|
help: Add return type annotation: `int`
116 | return 1
117 |
118 |
- def func(x: int):
119 + def func(x: int) -> int:
120 | try:
121 | pass
122 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
116 116 | return 1
117 117 |
118 118 |
119 |-def func(x: int):
119 |+def func(x: int) -> int:
120 120 | try:
121 121 | pass
122 122 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:128:5
@@ -381,15 +400,16 @@ ANN201 [*] Missing return type annotation for public function `func`
130 | pass
|
help: Add return type annotation: `int`
125 | return 2
126 |
127 |
- def func(x: int):
128 + def func(x: int) -> int:
129 | try:
130 | pass
131 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
125 125 | return 2
126 126 |
127 127 |
128 |-def func(x: int):
128 |+def func(x: int) -> int:
129 129 | try:
130 130 | pass
131 131 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:137:5
@@ -400,15 +420,16 @@ ANN201 [*] Missing return type annotation for public function `func`
139 | return 1
|
help: Add return type annotation: `int | None`
134 | return 2
135 |
136 |
- def func(x: int):
137 + def func(x: int) -> int | None:
138 | try:
139 | return 1
140 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
134 134 | return 2
135 135 |
136 136 |
137 |-def func(x: int):
137 |+def func(x: int) -> int | None:
138 138 | try:
139 139 | return 1
140 140 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:146:5
@@ -419,15 +440,16 @@ ANN201 [*] Missing return type annotation for public function `func`
148 | break
|
help: Add return type annotation: `int | None`
143 | pass
144 |
145 |
- def func(x: int):
146 + def func(x: int) -> int | None:
147 | while x > 0:
148 | break
149 | return 1
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
143 143 | pass
144 144 |
145 145 |
146 |-def func(x: int):
146 |+def func(x: int) -> int | None:
147 147 | while x > 0:
148 148 | break
149 149 | return 1
ANN201 Missing return type annotation for public function `method`
--> auto_return_type.py:158:9
@@ -492,15 +514,16 @@ ANN201 [*] Missing return type annotation for public function `method`
182 | return 1
|
help: Add return type annotation: `float`
177 | pass
178 |
179 | @abstractmethod
- def method(self):
180 + def method(self) -> float:
181 | if self.x > 0:
182 | return 1
183 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
177 177 | pass
178 178 |
179 179 | @abstractmethod
180 |- def method(self):
180 |+ def method(self) -> float:
181 181 | if self.x > 0:
182 182 | return 1
183 183 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:187:5
@@ -511,15 +534,16 @@ ANN201 [*] Missing return type annotation for public function `func`
189 | pass
|
help: Add return type annotation: `int | None`
184 | return 1.5
185 |
186 |
- def func(x: int):
187 + def func(x: int) -> int | None:
188 | try:
189 | pass
190 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
184 184 | return 1.5
185 185 |
186 186 |
187 |-def func(x: int):
187 |+def func(x: int) -> int | None:
188 188 | try:
189 189 | pass
190 190 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:194:5
@@ -530,15 +554,16 @@ ANN201 [*] Missing return type annotation for public function `func`
196 | pass
|
help: Add return type annotation: `int`
191 | return 2
192 |
193 |
- def func(x: int):
194 + def func(x: int) -> int:
195 | try:
196 | pass
197 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
191 191 | return 2
192 192 |
193 193 |
194 |-def func(x: int):
194 |+def func(x: int) -> int:
195 195 | try:
196 196 | pass
197 197 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:203:5
@@ -549,23 +574,24 @@ ANN201 [*] Missing return type annotation for public function `func`
205 | raise ValueError
|
help: Add return type annotation: `Never`
151 |
152 | import abc
153 | from abc import abstractmethod
154 + from typing import Never
155 |
156 |
157 | class Foo(abc.ABC):
Unsafe fix
151 151 |
152 152 | import abc
153 153 | from abc import abstractmethod
154 |+from typing import Never
154 155 |
155 156 |
156 157 | class Foo(abc.ABC):
--------------------------------------------------------------------------------
201 | return 3
202 |
203 |
- def func(x: int):
204 + def func(x: int) -> Never:
205 | if not x:
206 | raise ValueError
207 | else:
note: This is an unsafe fix and may change runtime behavior
200 201 | return 3
201 202 |
202 203 |
203 |-def func(x: int):
204 |+def func(x: int) -> Never:
204 205 | if not x:
205 206 | raise ValueError
206 207 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:210:5
@@ -576,15 +602,16 @@ ANN201 [*] Missing return type annotation for public function `func`
212 | raise ValueError
|
help: Add return type annotation: `int`
207 | raise TypeError
208 |
209 |
- def func(x: int):
210 + def func(x: int) -> int:
211 | if not x:
212 | raise ValueError
213 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
207 207 | raise TypeError
208 208 |
209 209 |
210 |-def func(x: int):
210 |+def func(x: int) -> int:
211 211 | if not x:
212 212 | raise ValueError
213 213 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:234:5
@@ -595,15 +622,16 @@ ANN201 [*] Missing return type annotation for public function `func`
236 | return 1
|
help: Add return type annotation: `int`
231 | return i
232 |
233 |
- def func(x: int):
234 + def func(x: int) -> int:
235 | if not x:
236 | return 1
237 | raise ValueError
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
231 231 | return i
232 232 |
233 233 |
234 |-def func(x: int):
234 |+def func(x: int) -> int:
235 235 | if not x:
236 236 | return 1
237 237 | raise ValueError
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:240:5
@@ -614,15 +642,16 @@ ANN201 [*] Missing return type annotation for public function `func`
242 | return 1
|
help: Add return type annotation: `int`
237 | raise ValueError
238 |
239 |
- def func(x: int):
240 + def func(x: int) -> int:
241 | if not x:
242 | return 1
243 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
237 237 | raise ValueError
238 238 |
239 239 |
240 |-def func(x: int):
240 |+def func(x: int) -> int:
241 241 | if not x:
242 242 | return 1
243 243 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:248:5
@@ -633,15 +662,16 @@ ANN201 [*] Missing return type annotation for public function `func`
250 | raise ValueError
|
help: Add return type annotation: `int | None`
245 | raise ValueError
246 |
247 |
- def func():
248 + def func() -> int | None:
249 | try:
250 | raise ValueError
251 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
245 245 | raise ValueError
246 246 |
247 247 |
248 |-def func():
248 |+def func() -> int | None:
249 249 | try:
250 250 | raise ValueError
251 251 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:255:5
@@ -652,15 +682,16 @@ ANN201 [*] Missing return type annotation for public function `func`
257 | return 1
|
help: Add return type annotation: `int | None`
252 | return 2
253 |
254 |
- def func():
255 + def func() -> int | None:
256 | try:
257 | return 1
258 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
252 252 | return 2
253 253 |
254 254 |
255 |-def func():
255 |+def func() -> int | None:
256 256 | try:
257 257 | return 1
258 258 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:262:5
@@ -671,15 +702,16 @@ ANN201 [*] Missing return type annotation for public function `func`
264 | if x > 0:
|
help: Add return type annotation: `int`
259 | pass
260 |
261 |
- def func(x: int):
262 + def func(x: int) -> int:
263 | for _ in range(3):
264 | if x > 0:
265 | return 1
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
259 259 | pass
260 260 |
261 261 |
262 |-def func(x: int):
262 |+def func(x: int) -> int:
263 263 | for _ in range(3):
264 264 | if x > 0:
265 265 | return 1
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:269:5
@@ -690,15 +722,16 @@ ANN201 [*] Missing return type annotation for public function `func`
271 | raise ValueError
|
help: Add return type annotation: `None`
266 | raise ValueError
267 |
268 |
- def func(x: int):
269 + def func(x: int) -> None:
270 | if x > 5:
271 | raise ValueError
272 | else:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
266 266 | raise ValueError
267 267 |
268 268 |
269 |-def func(x: int):
269 |+def func(x: int) -> None:
270 270 | if x > 5:
271 271 | raise ValueError
272 272 | else:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:276:5
@@ -709,15 +742,16 @@ ANN201 [*] Missing return type annotation for public function `func`
278 | raise ValueError
|
help: Add return type annotation: `None`
273 | pass
274 |
275 |
- def func(x: int):
276 + def func(x: int) -> None:
277 | if x > 5:
278 | raise ValueError
279 | elif x > 10:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
273 273 | pass
274 274 |
275 275 |
276 |-def func(x: int):
276 |+def func(x: int) -> None:
277 277 | if x > 5:
278 278 | raise ValueError
279 279 | elif x > 10:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:283:5
@@ -728,15 +762,16 @@ ANN201 [*] Missing return type annotation for public function `func`
285 | raise ValueError
|
help: Add return type annotation: `int | None`
280 | pass
281 |
282 |
- def func(x: int):
283 + def func(x: int) -> int | None:
284 | if x > 5:
285 | raise ValueError
286 | elif x > 10:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
280 280 | pass
281 281 |
282 282 |
283 |-def func(x: int):
283 |+def func(x: int) -> int | None:
284 284 | if x > 5:
285 285 | raise ValueError
286 286 | elif x > 10:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:290:5
@@ -747,15 +782,16 @@ ANN201 [*] Missing return type annotation for public function `func`
292 | return 5
|
help: Add return type annotation: `int`
287 | return 5
288 |
289 |
- def func():
290 + def func() -> int:
291 | try:
292 | return 5
293 | except:
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
287 287 | return 5
288 288 |
289 289 |
290 |-def func():
290 |+def func() -> int:
291 291 | try:
292 292 | return 5
293 293 | except:
ANN201 [*] Missing return type annotation for public function `func`
--> auto_return_type.py:299:5
@@ -766,12 +802,13 @@ ANN201 [*] Missing return type annotation for public function `func`
301 | case [1, 2, 3]:
|
help: Add return type annotation: `str | int`
296 | raise ValueError
297 |
298 |
- def func(x: int):
299 + def func(x: int) -> str | int:
300 | match x:
301 | case [1, 2, 3]:
302 | return 1
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
296 296 | raise ValueError
297 297 |
298 298 |
299 |-def func(x: int):
299 |+def func(x: int) -> str | int:
300 300 | match x:
301 301 | case [1, 2, 3]:
302 302 | return 1

View File

@@ -10,15 +10,16 @@ ANN201 [*] Missing return type annotation for public function `foo`
6 | pass
|
help: Add return type annotation: `None`
2 | from typing_extensions import override
3 |
4 | # Error
- def foo(a, b):
5 + def foo(a, b) -> None:
6 | pass
7 |
8 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
2 2 | from typing_extensions import override
3 3 |
4 4 | # Error
5 |-def foo(a, b):
5 |+def foo(a, b) -> None:
6 6 | pass
7 7 |
8 8 |
ANN001 Missing type annotation for function argument `a`
--> annotation_presence.py:5:9
@@ -47,15 +48,16 @@ ANN201 [*] Missing return type annotation for public function `foo`
11 | pass
|
help: Add return type annotation: `None`
7 |
8 |
9 | # Error
- def foo(a: int, b):
10 + def foo(a: int, b) -> None:
11 | pass
12 |
13 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
7 7 |
8 8 |
9 9 | # Error
10 |-def foo(a: int, b):
10 |+def foo(a: int, b) -> None:
11 11 | pass
12 12 |
13 13 |
ANN001 Missing type annotation for function argument `b`
--> annotation_presence.py:10:17
@@ -84,15 +86,16 @@ ANN201 [*] Missing return type annotation for public function `foo`
21 | pass
|
help: Add return type annotation: `None`
17 |
18 |
19 | # Error
- def foo(a: int, b: int):
20 + def foo(a: int, b: int) -> None:
21 | pass
22 |
23 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
17 17 |
18 18 |
19 19 | # Error
20 |-def foo(a: int, b: int):
20 |+def foo(a: int, b: int) -> None:
21 21 | pass
22 22 |
23 23 |
ANN201 [*] Missing return type annotation for public function `foo`
--> annotation_presence.py:25:5
@@ -103,15 +106,16 @@ ANN201 [*] Missing return type annotation for public function `foo`
26 | pass
|
help: Add return type annotation: `None`
22 |
23 |
24 | # Error
- def foo():
25 + def foo() -> None:
26 | pass
27 |
28 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
22 22 |
23 23 |
24 24 | # Error
25 |-def foo():
25 |+def foo() -> None:
26 26 | pass
27 27 |
28 28 |
ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a`
--> annotation_presence.py:45:12
@@ -293,15 +297,16 @@ ANN204 [*] Missing return type annotation for special method `__init__`
160 | ...
|
help: Add return type annotation: `None`
156 |
157 | class Foo:
158 | @decorator()
- def __init__(self: "Foo", foo: int):
159 + def __init__(self: "Foo", foo: int) -> None:
160 | ...
161 |
162 |
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
156 156 |
157 157 | class Foo:
158 158 | @decorator()
159 |- def __init__(self: "Foo", foo: int):
159 |+ def __init__(self: "Foo", foo: int) -> None:
160 160 | ...
161 161 |
162 162 |
ANN204 [*] Missing return type annotation for special method `__init__`
--> annotation_presence.py:165:9
@@ -313,10 +318,11 @@ ANN204 [*] Missing return type annotation for special method `__init__`
166 | print(f"{self.attr=}")
|
help: Add return type annotation: `None`
162 |
163 | # Regression test for: https://github.com/astral-sh/ruff/issues/7711
164 | class Class:
- def __init__(self):
165 + def __init__(self) -> None:
166 | print(f"{self.attr=}")
note: This is an unsafe fix and may change runtime behavior
Unsafe fix
162 162 |
163 163 | # Regression test for: https://github.com/astral-sh/ruff/issues/7711
164 164 | class Class:
165 |- def __init__(self):
165 |+ def __init__(self) -> None:
166 166 | print(f"{self.attr=}")

Some files were not shown because too many files have changed in this diff Show More