-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add "created-on" in config history #491
Conversation
87f8909
to
5e4a2c0
Compare
5e4a2c0
to
4ecbdea
Compare
azimuth/config.py
Outdated
@@ -461,7 +461,8 @@ def load_azimuth_config(config_path: Optional[str], load_config_history: bool) - | |||
config_history_path = cfg.get_config_history_path() | |||
try: | |||
with jsonlines.open(config_history_path, mode="r") as config_history: | |||
*_, last_config = config_history | |||
*_, last_config_info = config_history | |||
last_config = last_config_info["config"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the JSON was malformed, that would raise a KeyError
. I don't know if we want that. If we want to let pydantic parse the JSON and produce the "clear" errors, we can create a class like AzimuthConfigHistory
. I gave it a try in #493. It also has the advantage of defining how to create the datetime string inside the definition of AzimuthConfigHistory
, thanks to default_factory
. I don't know what approach is best. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Thank you! 👍
Description:
See commit messages.
Checklist:
You should check all boxes before the PR is ready. If a box does not apply, check it to acknowledge it.
ran
pre-commit run --all-files
at the end.our users.
README
files and our wiki for any big design decisions, if relevant.