Skip to content

implemented classify transform#82

Merged
ErikBjare merged 9 commits intomasterfrom
dev/classify
Oct 18, 2019
Merged

implemented classify transform#82
ErikBjare merged 9 commits intomasterfrom
dev/classify

Conversation

@ErikBjare
Copy link
Copy Markdown
Member

@ErikBjare ErikBjare commented Sep 21, 2019

Equivalent PR in aw-server-rust: ActivityWatch/aw-server-rust#67

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 21, 2019

Codecov Report

Merging #82 into master will decrease coverage by 0.45%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #82      +/-   ##
==========================================
- Coverage   95.32%   94.87%   -0.46%     
==========================================
  Files          33       34       +1     
  Lines        1561     1599      +38     
  Branches      238      248      +10     
==========================================
+ Hits         1488     1517      +29     
- Misses         41       44       +3     
- Partials       32       38       +6
Impacted Files Coverage Δ
aw_datastore/storages/memory.py 94.2% <100%> (ø) ⬆️
aw_datastore/datastore.py 100% <100%> (ø) ⬆️
aw_transform/__init__.py 100% <100%> (ø) ⬆️
aw_datastore/storages/peewee.py 99.21% <100%> (ø) ⬆️
aw_transform/chunk_events_by_key.py 90.47% <100%> (ø) ⬆️
aw_datastore/storages/__init__.py 100% <100%> (ø) ⬆️
aw_datastore/__init__.py 100% <100%> (ø) ⬆️
aw_query/query2.py 99.04% <100%> (ø) ⬆️
aw_datastore/storages/mongodb.py 97.84% <100%> (ø) ⬆️
aw_transform/split_url_events.py 100% <100%> (ø) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7f1f6c...95eed67. Read the comment docs.

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 7, 2019

This pull request introduces 1 alert and fixes 8 when merging d4db04d into b7f1f6c - view on LGTM.com

new alerts:

  • 1 for Unused import

fixed alerts:

  • 8 for Unused import

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 7, 2019

This pull request introduces 3 alerts and fixes 9 when merging 776ea7d into b7f1f6c - view on LGTM.com

new alerts:

  • 3 for Unused import

fixed alerts:

  • 8 for Unused import
  • 1 for Unused local variable

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 14, 2019

This pull request introduces 3 alerts and fixes 9 when merging ac92b89 into b7f1f6c - view on LGTM.com

new alerts:

  • 3 for Unused import

fixed alerts:

  • 8 for Unused import
  • 1 for Unused local variable

def __init__(self, rules: Dict[str, str]):
if "regex" in rules:
self.regex = re.compile(rules["regex"])
self.regex = re.compile(rules["regex"]) if rules["regex"] else None
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Spaghetti code, first you check if "regex" is in rules and then again you check if regex is in rules.

Would make more sense to write

    if "regex" in rules:
        self.regex = re.compile(rules["regex"])
    else:
        self.regex = None

Oh, now that I think of it it's even incorrect as well as "regex" is impossible to not be set and it is possible to set rules["regex"] = False which would be silly.

Copy link
Copy Markdown
Member Author

@ErikBjare ErikBjare Oct 16, 2019

Choose a reason for hiding this comment

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

It's not actually, the check is for when the regex string is an empty string, which would erroneously match everything. And regex might not be set at all, in the future another rule might be used instead.

It could be replaced with rules.get("regex", None) or None though, which is cleaner. Edit: Nevermind, actually it can't since it needs to pass through re.compile.

@ErikBjare ErikBjare merged commit 85bced9 into master Oct 18, 2019
@ErikBjare ErikBjare deleted the dev/classify branch October 18, 2019 08:53
@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 18, 2019

This pull request introduces 3 alerts and fixes 9 when merging 95eed67 into b7f1f6c - view on LGTM.com

new alerts:

  • 3 for Unused import

fixed alerts:

  • 8 for Unused import
  • 1 for Unused local variable

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.

2 participants