-
-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix more cached properties Using this shell and this python script (EXCLUDING `output_field`, will fix in another MR): ```shell rm -rf .mypy_cache/ && stubtest django \ --mypy-config-file mypy.ini \ --ignore-positional-only \ --allowlist scripts/stubtest/allowlist.txt | rg "cannot reconcile @Property on stub" -A4 > t.txt && cat t.txt | rg "Stub: in file " | cut -d" " -f4 > t2.txt ``` -------- ```python from collections import defaultdict line_to_fix = defaultdict(set) with open("t2.txt") as f: for line in f: file_path, lineno = line.strip().split(":") line_to_fix[file_path].add(int(lineno)) for file_path, line_numbers in line_to_fix.items(): lines = ["from django.utils.functional import cached_property\n"] with open(file_path) as f: lines.extend(f.readlines()) nb_lines = len(lines) for line_number in line_numbers: if line_number<nb_lines: lines[line_number] = lines[line_number].replace("@Property", "@cached_property") with open(file_path, "w") as f: f.writelines(lines) ```
- Loading branch information
1 parent
c7d6adc
commit 5bab9ae
Showing
25 changed files
with
231 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures | ||
from django.db.backends.sqlite3.features import DatabaseFeatures as SQLiteDatabaseFeatures | ||
from django.utils.functional import cached_property | ||
|
||
class DatabaseFeatures(BaseSpatialFeatures, SQLiteDatabaseFeatures): | ||
supports_3d_storage: bool | ||
@property | ||
@cached_property | ||
def supports_area_geodetic(self) -> bool: ... # type: ignore[override] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.