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

Support numeric times in time parser formatter #1254

Merged
merged 6 commits into from
Oct 5, 2016

Conversation

tagomoris
Copy link
Member

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.

@tagomoris tagomoris added enhancement Feature request or improve operations v0.14 labels Oct 4, 2016
@tagomoris
Copy link
Member Author

@repeatedly could you review this?
Many changes based on this follows.

@@ -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
Copy link
Member

@repeatedly repeatedly Oct 4, 2016

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?

Copy link
Member Author

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
Copy link
Member

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)
Copy link
Member

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.

@tagomoris
Copy link
Member Author

Updated the change.

@tagomoris
Copy link
Member Author

@repeatedly No more comments? I'll merge later if so.

@repeatedly
Copy link
Member

LGTM

@tagomoris tagomoris merged commit 9a7fa07 into master Oct 5, 2016
@tagomoris tagomoris deleted the support-numeric-times-in-time_parser_formatter branch October 5, 2016 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations v0.14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants