Repository: asdf-format/asdf

Issue:
No longer warn but raise an exception for converters with more than 1 tag that don't implement select tag
To provide backwards compatibility changes were added to:
https://github.com/asdf-format/asdf/pull/1594
where including a converter (that inherits from `Converter`) in an extension which results in the converter having more than 1 tag causes a warning.

For the next major version we should turn this into an error (as mentioned in the warning message).

Discussion:

Patch:
diff --git a/asdf/extension/_converter.py b/asdf/extension/_converter.py
index fca64a93..5e983562 100644
--- a/asdf/extension/_converter.py
+++ b/asdf/extension/_converter.py
@@ -4,9 +4,7 @@ types.  Will eventually replace the `asdf.types` module.
 """
 
 import abc
-import warnings
 
-from asdf.exceptions import AsdfWarning
 from asdf.util import get_class_name, uri_match
 
 
@@ -179,23 +177,8 @@ class ConverterProxy(Converter):
                 raise TypeError(msg)
 
         if len(relevant_tags) > 1 and not hasattr(delegate, "select_tag"):
-            # we cannot use isinstance here because Converter supports
-            # virtual subclasses
-            if Converter in delegate.__class__.__mro__:
-                # prior to asdf 3.0 Converter provided a default select_tag
-                # to provide backwards compatibility allow Converter subclasses
-                # to be registered with >1 tag but produce a warning
-                msg = (
-                    "Converter handles multiple tags for this extension, "
-                    "but does not implement a select_tag method. "
-                    "This previously worked because Converter subclasses inherited "
-                    "the now removed select_tag. This will be an error in a future "
-                    "version of asdf"
-                )
-                warnings.warn(msg, AsdfWarning)
-            else:
-                msg = "Converter handles multiple tags for this extension, but does not implement a select_tag method."
-                raise RuntimeError(msg)
+            msg = "Converter handles multiple tags for this extension, but does not implement a select_tag method."
+            raise RuntimeError(msg)
 
         self._tags = sorted(relevant_tags)
 
diff --git a/changes/1853.feature.rst b/changes/1853.feature.rst
new file mode 100644
index 00000000..f5817ef2
--- /dev/null
+++ b/changes/1853.feature.rst
@@ -0,0 +1,1 @@
+Raise RuntimeError if a Convert subclass supports multiple tags but doesn't implement select_tag.


Test patch:
diff --git a/asdf/_tests/test_extension.py b/asdf/_tests/test_extension.py
index f9b8baf5..d9a16c54 100644
--- a/asdf/_tests/test_extension.py
+++ b/asdf/_tests/test_extension.py
@@ -6,7 +6,7 @@ from packaging.specifiers import SpecifierSet
 
 import asdf
 from asdf import AsdfFile, config_context
-from asdf.exceptions import AsdfManifestURIMismatchWarning, AsdfSerializationError, AsdfWarning, ValidationError
+from asdf.exceptions import AsdfManifestURIMismatchWarning, AsdfSerializationError, ValidationError
 from asdf.extension import (
     Compressor,
     Converter,
@@ -892,10 +892,8 @@ def test_warning_or_error_for_default_select_tag(is_subclass, indirect):
         "asdf://somewhere.org/tags/foo-2.0.0",
     ]
     extension = FullExtension(converters=[FooConverter()], tags=tags)
-    ctx_type = pytest.warns if is_subclass else pytest.raises
-    exception_class = AsdfWarning if is_subclass else RuntimeError
     with config_context() as config:
-        with ctx_type(exception_class, match="Converter handles multiple tags"):
+        with pytest.raises(RuntimeError, match="Converter handles multiple tags"):
             config.add_extension(extension)