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

fix for issue/217-Specifying-asterisk-as-query-causes-error #250

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

theKashyap
Copy link

@theKashyap theKashyap commented Apr 17, 2019

Fix for #217
Added fix for #180 as well.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 92.557% when pulling b644e95 on theKashyap:issue/217-Specifying-asterisk-as-query-causes-error into 401870b on jorgebastida:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 92.557% when pulling b644e95 on theKashyap:issue/217-Specifying-asterisk-as-query-causes-error into 401870b on jorgebastida:master.

@coveralls
Copy link

coveralls commented Apr 17, 2019

Coverage Status

Coverage increased (+0.5%) to 92.557% when pulling c3a7412 on theKashyap:issue/217-Specifying-asterisk-as-query-causes-error into 401870b on jorgebastida:master.

@theKashyap
Copy link
Author

@Code0x58 , @jorgebastida get back if you see anything wrong with this. Else it's been waiting to be merged for a while now.

Copy link
Contributor

@Code0x58 Code0x58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change, just a couple of minor bits that could be updated

return s


def seconds_since_epoch(datetime_text):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Milliseconds since epoch?

Good change 👍

except Exception as e:
raise exceptions.InvalidPythonRegularExpressionError('Log stream name pattern', s)

return s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually the return value/what is passed around after handling the CLI would be the compiled regex - it may also speed up the code if it the code using it is called more than once, as the cache use isn't free.


- Expressions can be regular expressions or the wildcard ``ALL`` if you want any and don't want to type ``.*``.
- STREAM_EXPRESSION is a python regular expression accepted by ``re.compile()`` `described here <https://docs.python.org/3/library/re.html#regular-expression-syntax>`_. Expression ``ALL`` is reserved and is same as ``'.*'``. Remember to quote/escape shell special characters to ensure they are not gobbled up by shell variable expansion. E.g. ``'2014-04.*'`` instead of ``2014-04.*``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't mention how the regex is used. It is used in .match(…), rather than say .fullmatch(…) (which I might prefer but have no strong opinion†) ,or .search(…) (which it sounds like that's how people imagine it being used).

† changing from .match(…) would be a breaking change (dropping the ^ but still using .match(…) is not as it acts exactly the same) so should be a major version change+in release notes

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

Successfully merging this pull request may close these issues.

3 participants