Daniel Gafni
06/26/2023, 8:57 AMDBIOManager
has the following limitations:
1. If the schema is specified in the IOManager config, the asset can't have a prefix:
if len(asset_key_path) > 1 and self._schema:
raise DagsterInvalidDefinitionError(
f"Asset {asset_key_path} specifies a schema with "
f"its key prefixes {asset_key_path[:-1]}, but schema "
f"{self._schema} was also provided via run config. "
"Schema can only be specified one way."
)
2. If the schema is specified with the asset metadata, the IOManager can't have it configured:
if output_context_metadata.get("schema") and self._schema:
raise DagsterInvalidDefinitionError(
f"Schema {output_context_metadata.get('schema')} "
"specified via output metadata, but conflicting schema "
f"{self._schema} was provided via run_config. "
"Schema can only be specified one way."
)
May I ask why? It seems to me like the overrides hierarchy is really clear: the asset metadata is the lowest level (and should have the highest priority), then goes the asset prefix, then goes the IOManager itself.
Usually a lot of assets may share the IOManager, a subset of them may share the prefix, and the metadata is only defined for specific assets.
Right now I can't use asset prefixes with a configured IOManager. I would really like to have prefixes and allow them to override the configured IOManager schema.
Consider removing this limitations. None of the current code would break because if this change.sean
06/26/2023, 10:36 PMDaniel Gafni
06/27/2023, 5:36 AM