-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support numeric times in time parser formatter #1254
Support numeric times in time parser formatter #1254
Conversation
@repeatedly could you review this? |
@@ -199,6 +213,12 @@ def compat_parameters_formatter(conf) | |||
# TODO: warn obsolete parameters if these are deprecated | |||
attr = compat_parameters_copy_to_subsection_attributes(conf, FORMATTER_PARAMS) | |||
|
|||
# TODO: make a utility method in TimeFormatter to handle these conversion |
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.
This comment is still needed? Hard to implement in TimeFormatter?
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.
time_as_epoch
shouldn't be implemented in TimeFormatter, because it's now have time_type
for unixtime, float (and string). It's just for compatibility for existing plugins.
@@ -199,6 +213,12 @@ def compat_parameters_formatter(conf) | |||
# TODO: warn obsolete parameters if these are deprecated | |||
attr = compat_parameters_copy_to_subsection_attributes(conf, FORMATTER_PARAMS) | |||
|
|||
# TODO: make a utility method in TimeFormatter to handle these conversion | |||
# copies of this code: plugin_helper/compat_parameters, compat/formatter_utils and here |
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.
"and here" can be removed.
@@ -199,6 +213,12 @@ def compat_parameters_formatter(conf) | |||
# TODO: warn obsolete parameters if these are deprecated | |||
attr = compat_parameters_copy_to_subsection_attributes(conf, FORMATTER_PARAMS) |
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.
Off topic. Ruby has Module#attr
method so avoiding same name is better.
Updated the change. |
@repeatedly No more comments? I'll merge later if so. |
LGTM |
There's many use cases to parse/format times in unix time or floating point values.
It should be supported by built-in TimeParser/TimeFormatter and common configurations.
This change also implements timezone control in extracting timestamp placeholders in compat_parameters.