Skip to content

Commit

Permalink
Replace import of collections.Sequence with collections.abc.Sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverholworthy committed Jun 30, 2023
1 parent 94f74b5 commit b87b99d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions merlin/models/tf/core/tabular.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import abc
import collections
import collections.abc
import copy
from typing import Dict, List, Optional, Sequence, Union, overload

Expand Down Expand Up @@ -600,7 +600,7 @@ def get_config(self):
def select_by_tag(self, tags: Tags) -> Optional["Filter"]:
if isinstance(self.feature_names, Tags):
schema = self.schema.select_by_tag(self.feature_names).select_by_tag(tags)
elif isinstance(self.feature_names, collections.Sequence):
elif isinstance(self.feature_names, collections.abc.Sequence):
schema = self.schema.select_by_name(self.feature_names).select_by_tag(tags)
else:
raise RuntimeError(
Expand Down
4 changes: 2 additions & 2 deletions merlin/models/tf/inputs/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import collections
import collections.abc
import inspect
from copy import deepcopy
from dataclasses import dataclass
Expand Down Expand Up @@ -268,7 +268,7 @@ def select_by_tag(self, tags: Union[Tags, Sequence[Tags]]) -> Optional["Embeddin
-------
An EmbeddingTable if the tags match. If no features match, it returns None.
"""
if not isinstance(tags, collections.Sequence):
if not isinstance(tags, collections.abc.Sequence):
tags = [tags]

selected_schema = self.schema.select_by_tag(tags)
Expand Down

0 comments on commit b87b99d

Please sign in to comment.