From a89793b4125d541adf91daf848e714c38e470d5e Mon Sep 17 00:00:00 2001 From: Timofey Koolin Date: Fri, 8 Dec 2023 11:58:27 +0300 Subject: [PATCH] removed @dataclass removed func _missing_ for SchemeEntryType --- CHANGELOG.md | 2 ++ ydb/_errors.py | 3 --- ydb/scheme.py | 4 ---- ydb/scheme_test.py | 8 -------- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44fcd779..6d856014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Fixed python2 compatibility + ## 2.15.0 ## * Fixed python2 compatibility diff --git a/ydb/_errors.py b/ydb/_errors.py index e7524e5a..84ac23db 100644 --- a/ydb/_errors.py +++ b/ydb/_errors.py @@ -1,5 +1,3 @@ -from dataclasses import dataclass - from . import issues _errors_retriable_fast_backoff_types = [ @@ -56,7 +54,6 @@ def check_retriable_error(err, retry_settings, attempt): return ErrorRetryInfo(False, None) -@dataclass class ErrorRetryInfo: def __init__(self, is_retriable, sleep_timeout_seconds=None): self.is_retriable = is_retriable diff --git a/ydb/scheme.py b/ydb/scheme.py index 88eca78c..4e8b716d 100644 --- a/ydb/scheme.py +++ b/ydb/scheme.py @@ -25,10 +25,6 @@ class SchemeEntryType(enum.IntEnum): REPLICATION = 16 TOPIC = 17 - @classmethod - def _missing_(cls, value): - return cls.TYPE_UNSPECIFIED - @staticmethod def is_table(entry): """ diff --git a/ydb/scheme_test.py b/ydb/scheme_test.py index d63850bf..d7e76b59 100644 --- a/ydb/scheme_test.py +++ b/ydb/scheme_test.py @@ -15,14 +15,6 @@ def test_wrap_scheme_entry(): assert ( _wrap_scheme_entry(ydb_scheme.Entry()).type is SchemeEntryType.TYPE_UNSPECIFIED ) - assert ( - _wrap_scheme_entry(ydb_scheme.Entry(type=10)).type - is SchemeEntryType.TYPE_UNSPECIFIED - ) - assert ( - _wrap_scheme_entry(ydb_scheme.Entry(type=1001)).type - is SchemeEntryType.TYPE_UNSPECIFIED - ) def test_wrap_list_directory_response():