Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed May 13, 2024
1 parent 019c6a4 commit 7e9db33
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions asdf/_asdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from ._helpers import validate_version
from .config import config_context, get_config
from .exceptions import (
AsdfConversionWarning,
AsdfDeprecationWarning,
AsdfManifestURIMismatchWarning,
AsdfPackageVersionWarning,
Expand Down Expand Up @@ -169,10 +168,6 @@ def __init__(
self._ignore_unrecognized_tag = ignore_unrecognized_tag
self._ignore_implicit_conversion = ignore_implicit_conversion

# Set of (string, string) tuples representing tag version mismatches
# that we've already warned about for this file.
self._warned_tag_pairs = set()

# Context of a call to treeutil.walk_and_modify, needed in the AsdfFile
# in case walk_and_modify is re-entered by extension code (via
# custom_tree_to_tagged_tree or tagged_tree_to_custom_tree).
Expand Down Expand Up @@ -1592,20 +1587,6 @@ def search(self, key=NotSet, type_=NotSet, value=NotSet, filter_=None):
result = AsdfSearchResult(["root"], self.tree)
return result.search(key=key, type_=type_, value=value, filter_=filter_)

# This function is called from within TypeIndex when deserializing
# the tree for this file. It is kept here so that we can keep
# state on the AsdfFile and prevent a flood of warnings for the
# same tag.
def _warn_tag_mismatch(self, tag, best_tag):
if not self._ignore_version_mismatch and (tag, best_tag) not in self._warned_tag_pairs:
message = (
f"No explicit ExtensionType support provided for tag '{tag}'. "
f"The ExtensionType subclass for tag '{best_tag}' will be used instead. "
"This fallback behavior will be removed in asdf 3.0."
)
warnings.warn(message, AsdfConversionWarning)
self._warned_tag_pairs.add((tag, best_tag))

# This function is called from within yamlutil methods to create
# a context when one isn't explicitly passed in.
def _create_serialization_context(self, operation=_serialization_context.BlockAccess.NONE):
Expand Down

0 comments on commit 7e9db33

Please sign in to comment.