|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | | -import warnings |
4 | 3 | from functools import cached_property |
5 | | -from typing import Any, Iterator, List, Optional, Tuple |
| 4 | +from typing import List, Optional, Tuple |
6 | 5 |
|
7 | 6 | from .. import errors, helpers, types |
8 | 7 | from ..exception import FrictionlessException |
@@ -67,38 +66,6 @@ def __init__( |
67 | 66 | self.__matching = LabelMatching(labels, self.__fields, ignore_case=ignore_case) |
68 | 67 | self.__process() |
69 | 68 |
|
70 | | - # Deprecated |
71 | | - |
72 | | - def __warn_list_usage(self, usage: str) -> None: |
73 | | - warnings.warn( |
74 | | - f"Using a Header as a list ({usage}) is deprecated, as the list " |
75 | | - "ambiguously holds the names of the schema fields. Use " |
76 | | - "`header.field_names` instead, or `header.labels` for the header " |
77 | | - "row as read from the data source.", |
78 | | - DeprecationWarning, |
79 | | - stacklevel=3, |
80 | | - ) |
81 | | - |
82 | | - def __eq__(self, other: Any) -> bool: |
83 | | - self.__warn_list_usage("==") |
84 | | - return super().__eq__(other) |
85 | | - |
86 | | - def __getitem__(self, index: Any) -> Any: |
87 | | - self.__warn_list_usage("[]") |
88 | | - return super().__getitem__(index) |
89 | | - |
90 | | - def __iter__(self) -> Iterator[str]: |
91 | | - self.__warn_list_usage("iteration") |
92 | | - return super().__iter__() |
93 | | - |
94 | | - def __len__(self) -> int: |
95 | | - self.__warn_list_usage("len()") |
96 | | - return super().__len__() |
97 | | - |
98 | | - def __contains__(self, item: Any) -> bool: |
99 | | - self.__warn_list_usage("in") |
100 | | - return super().__contains__(item) |
101 | | - |
102 | 69 | @cached_property |
103 | 70 | def labels(self): |
104 | 71 | """ |
|
0 commit comments