Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

component as type instead of string #218

Open
RonnyPfannschmidt opened this issue Aug 19, 2024 · 4 comments
Open

component as type instead of string #218

RonnyPfannschmidt opened this issue Aug 19, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@RonnyPfannschmidt
Copy link

in a application i'm working on, components are identified by type/type name

instead of passing them in as strings, i would like to use the type as key for consistency

@Tishka17
Copy link
Collaborator

Tishka17 commented Aug 19, 2024

Components are designed to be used only for subgraphs isolation. I cannot imagine how you can use types here. Anyway, there are currently almost no limitations on what you can use as a component except that they should be hashable. Type hints say that it should be only string and it is planned to be the only guaranteed way to use them, though we are not planning to break others.

Can you, please, provide more details on how are using components? Probably, we can offer another solution or extend library for your case

@Tishka17 Tishka17 added the enhancement New feature or request label Aug 19, 2024
@RonnyPfannschmidt
Copy link
Author

im trying to use the python type of a application component instead of its name

the application is lined up that each plugin repressents a different part, and most plugins have some nested services they personally use

a small subset of plugins provide "global" services consumed by the larger "ecosystem"

@Tishka17
Copy link
Collaborator

Ok, sounds interesting. We'll think how can we weaken requirements for a componente type without taking to much responsibility from our side

@RonnyPfannschmidt
Copy link
Author

Lookup by entry point, types, strings and enums come to mind

Keeping the baseline default limited to strings and requiring some extra work for fancy components seems fair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants