Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where custom environment plugins were lost on dataset merge (#…
…1582) I ran into an issue where plugins loaded into the `Environment` are not retained after merging. Turns out a generator is being passed to [Environment.merge](https://github.com/openvinotoolkit/datumaro/blob/30b1add52d6fe458dba5e32e1f63ffeea999ad7b/src/datumaro/components/environment.py#L271) instead of the expected Sequence. This meant that custom plugins were never registered into the merged environment. Reproducible example: ```python from datumaro.components.dataset import Dataset from datumaro.components.environment import Environment from datumaro.components.exporter import Exporter from datumaro.components.hl_ops import HLOps from datumaro.components.media import Image class MyPlugin(Exporter): pass environment = Environment() environment.exporters.register('my_plugin', MyPlugin) dataset1 = Dataset(media_type=Image, env=environment) datasets = [dataset1, dataset1.clone()] merged = HLOps.merge(*datasets) assert 'my_plugin' in dataset1.env.exporters # Passes assert 'my_plugin' in merged.env.exporters # Fails ``` --------- Co-authored-by: Sooah Lee <[email protected]>
- Loading branch information