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

The Historian should automatically register unknown types when the user explicitly uses them #21

Closed
muhrin opened this issue May 19, 2022 · 1 comment
Assignees

Comments

@muhrin
Copy link
Owner

muhrin commented May 19, 2022

For example, in issue #20 , User is explicitly being passed to find() means that the user expects the historian to know this type, in which case we can take the liberty of registering it automatically (if it is not already registered). To avoid the possibility of clobbering an existing type the call should throw an exception if the TYPE_ID already exists.

There may be other historian methods where this kind of automatic registration could be useful.

@muhrin
Copy link
Owner Author

muhrin commented May 19, 2022

Ok, this functionality has been added to find() and is available from #v0.15.18 .

historian.register_type() will clobber whatever was registered before (which was the previous behaviour anyway), and historian.type_registry.register_type() will, by default, raise in such a scenario but this can be overridden with a replace=True flag.

@muhrin muhrin closed this as completed May 19, 2022
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

No branches or pull requests

1 participant