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

Convertion between ContextEntity and ContextEntityKeyvalues #372

Open
djs0109 opened this issue Jan 15, 2025 · 1 comment
Open

Convertion between ContextEntity and ContextEntityKeyvalues #372

djs0109 opened this issue Jan 15, 2025 · 1 comment
Assignees
Labels
feature request Request a potential feature

Comments

@djs0109
Copy link
Contributor

djs0109 commented Jan 15, 2025

Describe the solution you'd like
There are two formats of entity, i.e., ContextEntity and ContextEntityKeyValues. It will be good to have conversion methods (like to_keyvalues and to_normalized) locally.

entities: List[ContextEntity] = ...
entities_convert_keyvalues = [entity.to_keyvalues() for entity in entities]

entities_keyvalues: List[ContextEntityKeyValues] = ...
entities_convert_normalized = [entity_keyvalue.to_normalized() for entity_keyvaluein entities_keyvalues]

Additional context
Be aware that the ContextEntity inherits ContextEntityKeyValues. Therefore, the to_normalized() method must be deactivated in class.

@djs0109 djs0109 added the feature request Request a potential feature label Jan 15, 2025
Copy link

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

No branches or pull requests

2 participants