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

Review usage of arrow.get() for Arrow 0.15.0 #313

Merged
merged 1 commit into from
Sep 18, 2019

Conversation

davidag
Copy link
Contributor

@davidag davidag commented Sep 10, 2019

Arrow 0.15.0 has been recently released and the warning messages mentioned in #296 have disappeared.

After reading the comments in that issue and reviewing the code, it seems to me that only user date input can be affected for some commands. For example, if someone relied on using timestamps in the command line, errors will probably be raised with Arrow 0.15.0.

@ryanmjacobs It would be great if you could review my changes and compare them with those you made a month ago 😌

Changes:

  • Reduce the number of uses of arrow.get() related to spans in reports.
  • Unify catched exceptions when calling arrow.get().
  • Include Frame.updated_at parsing inside try/catch just like
    start/stop.

@davidag
Copy link
Contributor Author

davidag commented Sep 11, 2019

Of course, a review from @k4nar would be great, as much of this code is his! ☺️

Copy link
Collaborator

@k4nar k4nar left a comment

Choose a reason for hiding this comment

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

This looks good to me, but shouldn't we pin arrow to >0.15 in the setup then?

@davidag
Copy link
Contributor Author

davidag commented Sep 11, 2019

@k4nar I think that would be great, not because these changes require Arrow 0.15.0 (they should work fine with older Arrow versions), but to take advantage of all the fixes and improvements in that library. If you agree with this, I'll change the requirements.txt to arrow >= 0.15.0.

@k4nar
Copy link
Collaborator

k4nar commented Sep 11, 2019

Ah ok, I thought the changes were not backwards compatible. Then yes, updating the requirements.txt (and not the setup.py) should be enough 👍 .

@davidag
Copy link
Contributor Author

davidag commented Sep 11, 2019

It looks like setup.py gets the requirements from requirements.txt so it would be effectively upgraded too. Could that be a problem with distribution/packaging dependencies?

@jmaupetit
Copy link
Contributor

This is a strong requirement that might break many users installation. If it's not required, I would not limit requirements. But we should mention it in the installation docs. WDYT?

@davidag
Copy link
Contributor Author

davidag commented Sep 11, 2019

This is a strong requirement that might break many users installation. If it's not required, I would not limit requirements.

Perfect, let's keep the requirements as they are.

But we should mention it in the installation docs. WDYT?

I'm not sure I understand what should be mentioned in the installation docs. I can't find any mention to requirementes or dependencies 🤷‍♂️

@jmaupetit
Copy link
Contributor

I would have wrote something in the single user installation section, but it will make things complicated when it's not required. Forget it.

@jmaupetit
Copy link
Contributor

I think these changes are worth mentioning in the CHANGELOG. WDYT?

@davidag
Copy link
Contributor Author

davidag commented Sep 13, 2019

I think these changes are worth mentioning in the CHANGELOG. WDYT?

Sure! I've just added a line 👍

It would be ideal that @ryanmjacobs reviewed and added his changes before merging this, but of course, he could do that a posteriori if you think this can be merged as is.

@ryanmjacobs
Copy link

ryanmjacobs commented Sep 13, 2019 via email

- Reduce the number of uses of arrow.get() related to spans in reports.
- Unify catched exceptions when calling arrow.get().
- Include 'Frame.updated_at' parsing inside try/catch just like
start/stop.
@davidag
Copy link
Contributor Author

davidag commented Sep 16, 2019

@ryanmjacobs Thank you! I think it's worth waiting for your changes then, even if it takes a bit more time, don't worry 👍

@ryanmjacobs
Copy link

@davidag Great, I've set aside time to rebase my changes tonight. I'll ping you in this thread when it's done.

@ryanmjacobs
Copy link

ryanmjacobs commented Sep 18, 2019

Okay, I've pushed my old changes... (I guess I never committed them...)

Looks like the only change I made was this: ryanmjacobs@80363e6. However, I like what you are doing more -- which is reducing arrow.get() usage altogether.

I've run setup.py install on my system using your repository. I see no errors with watson start test, watson stop, watson sync, and then watson log -a. Prior to these changes, I was getting errors on watson sync and watson log. All of my new and prior log data looks fine (correct datetimes and everything).


I might be totally wrong on this part. But if it's fine, then I think we are good to merge.

My only worry is watson report --csv, which I think was introduced after 1.7.0. I see that you've made changes to utils.py in the CSV function used for report() (https://github.com/TailorDev/Watson/pull/313/files#diff-53886fd7d4ba12dfad3dbb6c9716ca57L381).

Anyways, until today, I've been running 1.7.0. watson report -a looks fine to me, but watson report -a --csv gives me this. It looks funny, but maybe that's what the output is supposed to look like.

$ watson report -a --csv
from,to,project,tag,time
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,,194312.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,SearchBox,11778.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,app-js-overhaul,46644.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,debug-integration-whitescreen,101.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,demo-route,1157.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,deploy-remote-clone,2870.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,error-modal,1091.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,fix-dateslider-after-overhaul,1259.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,fix-remove-integration,4797.0
1970-01-01 00:00:00,2019-09-17 23:59:59,redacted,gridbuilder-streamline,105833.0
...

While watson report -a gives me this:

$ watson report -a
redacted - 53h 58m 32s
        [SearchBox  3h 16m 18s]
        [app-js-overhaul 12h 57m 24s]
        [debug-integration-whitescreen     01m 41s]
        [demo-route     19m 17s]
        [deploy-remote-clone     47m 50s]
        [error-modal     18m 11s]
        [fix-dateslider-after-overhaul     20m 59s]
        [fix-remove-integration  1h 19m 57s]
        [gridbuilder-streamline 29h 23m 53s]
        [local-backend     13m 00s]
        [onboarding-cleanup     24m 30s]
        [onboarding-debug  1h 29m 58s]
... 

edit: My gut is telling me that it's supposed to look like that. But I'm just not 100% sure.

@davidag
Copy link
Contributor Author

davidag commented Sep 18, 2019

@ryanmjacobs Thank you for your comment, it's great you could test my changes and provide yours!

After careful reading, I'm not sure I understand your concerns with the output of watson report -a --csv.

When I developed the --csv option I got inspiration from --json, where the output times are in seconds, which made total sense to allow other tools to easily parse and transform the generated csv/json dump. You could compare the output using both formats.

If what worries you is that the end of the interval is 2019-09-17 23:59:59 instead of 2019-09-16 00:00:00, I think the former is correct. You might want to look at class Span in frames.py, which is used to build the span in watson.report().

Please let me know if I'm missing something!

@ryanmjacobs
Copy link

ryanmjacobs commented Sep 18, 2019 via email

@davidag
Copy link
Contributor Author

davidag commented Sep 18, 2019

@ryanmjacobs Yes, I think that's normal too, thank you again!

@jmaupetit I guess this is ready to merge 🎉

@jmaupetit jmaupetit merged commit 297fd7f into jazzband:master Sep 18, 2019
@davidag davidag deleted the review-arrow-get-usage branch September 18, 2019 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants