asdf-format/asdf

Document that adding a converter that doesn't support a tag in an extension will result in the converter being ignored

Opened this issue · 0 comments

Currently, adding a converter to an extension where the converter only supports tags not in the extension results in the converter being silently.

if not len(self._tags) and not hasattr(delegate, "select_tag"):
# this converter supports no tags so don't inspect the types
return

This seems generally useful (asdf-astropy uses it extensively to support, for example, multiple transforms extensions with the same long list of converters with wildcard tags).

However this could confusing when developing an extension as if one forgets to add a tag to the extension there is no error until the object is attempted to be converted. During the conversion at best the developer will get a confusing cannot represent an object or at worst the object will be converted by a different extension (and possibly incorrect tag version).

I'm not sure there is a good way to issue a warning without requiring asdf-astropy (for example) to duplicate part of the structure of the manifest (having to know which converters go with which extensions).

As a minimal improvement this silent ignoring of converters should be documented.