Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit dc1bde1

Browse files
author
Sergey Vasilyev
committed
Cease usage of the self-made Self , switch to Python's backported one
1 parent 47c070e commit dc1bde1

File tree

7 files changed

+14
-16
lines changed

7 files changed

+14
-16
lines changed

data_diff/cloud/datafold_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
import dataclasses
33
import enum
44
import time
5-
from typing import Any, Dict, List, Optional, Type, TypeVar, Tuple
5+
from typing import Any, Dict, List, Optional, Type, Tuple
66

77
import pydantic
88
import requests
9+
from typing_extensions import Self
910

1011
from data_diff.errors import DataDiffCloudDiffFailed, DataDiffCloudDiffTimedOut, DataDiffDatasourceIdNotFoundError
1112

1213
from ..utils import getLogger
1314

1415
logger = getLogger(__name__)
1516

16-
Self = TypeVar("Self", bound=pydantic.BaseModel)
17-
1817

1918
class TestDataSourceStatus(str, enum.Enum):
2019
SUCCESS = "ok"

data_diff/sqeleton/abcs/database_types.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import decimal
22
from abc import ABC, abstractmethod
3-
from typing import Sequence, Optional, Tuple, Union, Dict, List
3+
from typing import Sequence, Optional, Tuple, Type, Union, Dict, List
44
from datetime import datetime
55

66
from runtype import dataclass
7+
from typing_extensions import Self
78

8-
from ..utils import ArithAlphanumeric, ArithUUID, Self, Unknown
9+
from ..utils import ArithAlphanumeric, ArithUUID, Unknown
910

1011

1112
DbPath = Tuple[str, ...]

data_diff/sqeleton/databases/_connect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
import toml
66

77
from runtype import dataclass
8+
from typing_extensions import Self
89

910
from ..abcs.mixins import AbstractMixin
10-
from ..utils import WeakCache, Self
11+
from ..utils import WeakCache
1112
from .base import Database, ThreadedDatabase
1213
from .postgresql import PostgreSQL
1314
from .mysql import MySQL

data_diff/sqeleton/databases/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
import decimal
1212

1313
from runtype import dataclass
14+
from typing_extensions import Self
1415

15-
from ..utils import is_uuid, safezip, Self
16+
from ..utils import is_uuid, safezip
1617
from ..queries import Expr, Compiler, table, Select, SKIP, Explain, Code, this
1718
from ..queries.ast_classes import Random
1819
from ..abcs.database_types import (

data_diff/sqeleton/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121

2222
# -- Common --
2323

24-
try:
25-
from typing import Self
26-
except ImportError:
27-
Self = Any
28-
2924

3025
class WeakCache:
3126
def __init__(self):

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ vertica-python = {version="*", optional=true}
4646
urllib3 = "<2"
4747
oracledb = {version = "*", optional=true}
4848
pyodbc = {version="^4.0.39", optional=true}
49+
typing-extensions = ">=4.0.1"
4950

5051
[tool.poetry.dev-dependencies]
5152
parameterized = "*"

0 commit comments

Comments
 (0)