Skip to content

Replace dynamic imports with component registry lookup in converter job class#333

Merged
cristian-tamblay merged 1 commit into
developfrom
fix/converter-job
Oct 20, 2025
Merged

Replace dynamic imports with component registry lookup in converter job class#333
cristian-tamblay merged 1 commit into
developfrom
fix/converter-job

Conversation

@Irozuku
Copy link
Copy Markdown
Collaborator

@Irozuku Irozuku commented Oct 17, 2025

This pull request refactors the way converter classes are instantiated in the converter_job.py file. Instead of dynamically importing converter modules using string manipulation and import_module, the code now retrieves converter classes directly from a component_registry provided by dependency injection. This simplifies the instantiation logic and reduces the risk of import errors.

Key changes:

Refactoring converter instantiation:

  • Removed the use of import_module and dynamic module path construction for importing converters, replacing it with a lookup in the injected component_registry for the converter class.

@cristian-tamblay
Copy link
Copy Markdown
Member

Thank you this fixes a lot of import problems in the executables too. I wonder if this exact problem is somewhere else. I think some devs/students didnt get how to use the dependency injection and class instanciation, this is a clear case of this.

@cristian-tamblay cristian-tamblay merged commit 7e28f7a into develop Oct 20, 2025
5 checks passed
@cristian-tamblay cristian-tamblay deleted the fix/converter-job branch October 20, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants