You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@aurora.apache.org by Kevin Sweeney <ke...@apache.org> on 2015/05/22 01:15:12 UTC

Review Request 34570: Use set-literals and set-comprehensions where possible

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/
-----------------------------------------------------------

Review request for Aurora, Joshua Cohen and Brian Wickman.


Repository: aurora


Description
-------

Use Python 2.7 set-literal and set-comprehension syntax where possible.

There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.


Diffs
-----

  3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
  src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
  src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
  src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
  src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
  src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
  src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
  src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
  src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
  src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
  src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
  src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
  src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
  src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
  src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
  src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
  src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
  src/test/python/apache/aurora/BUILD 885e610a640f96583189d9b0f88c96efff0aa106 
  src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
  src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
  src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
  src/test/python/apache/aurora/client/cli/BUILD 5d922965dfbaf2eb0dc938e3d4d13f4cacb49627 
  src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
  src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
  src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
  src/test/python/apache/aurora/thrift_util.py PRE-CREATION 

Diff: https://reviews.apache.org/r/34570/diff/


Testing
-------

I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.

To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).

./pants test.pytest --no-fast src/test/python::


Thanks,

Kevin Sweeney


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review86883
-----------------------------------------------------------


Master (a1f7b3d) is red with this patch.
  ./build-support/jenkins/build.sh

SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/bin/thermos_runner.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/bin/thermos_ckpt.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/bin/__init__.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/schema.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/loader.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/schema_base.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/schema_helpers.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/dsl.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/__init__.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/bin/config_load.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/config/bin/config_repl.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/resource.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/disk.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/monitor.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/process.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/garbage.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/__init__.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/detector.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/monitoring/process_collector_psutil.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/common/planner.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/common/options.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/common/path.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/common/ckpt.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/common/constants.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/common/statuses.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/common/__init__.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/common.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/main.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/kill.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/read.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/tail.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/gc.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/simplerun.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/run.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/status.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/inspect.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/commands/help.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/cli/bin/thermos.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/testing/runner.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/main/python/apache/thermos/testing/__init__.py Everything Looks Good!


I will refresh this build result if you post a review containing "@ReviewBot retry"

- Aurora ReviewBot


On May 21, 2015, 11:28 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 11:28 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Joshua Cohen <jc...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review86878
-----------------------------------------------------------

Ship it!


Presumably you'll need to rebase.

- Joshua Cohen


On May 21, 2015, 11:28 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 11:28 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Joe Smith <ya...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review86872
-----------------------------------------------------------

Ship it!


Also LGTM pending jcohen's comment

- Joe Smith


On May 21, 2015, 4:28 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 4:28 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Kevin Sweeney <ke...@apache.org>.

> On May 21, 2015, 5:22 p.m., Joshua Cohen wrote:
> > src/main/python/apache/aurora/client/api/__init__.py, line 114
> > <https://reviews.apache.org/r/34570/diff/2/?file=968393#file968393line114>
> >
> >     Do we care that we're going from an immutable to a mutable set with this change (here and elsewhere)?

I don't think so - we haven't been strong on the "everything must be immutable" style in Python - this statement for example is already mutating a TaskQuery instance. I think it's somewhat the nature of the language that *everything* is mutable in practice and only immutable by convention - there are no final fields for example. I think using a consistent style across the codebase outweighs here, and if we want to make sure everything is immutable (as enforced by the language) later we should do a full refactor for that.


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review84837
-----------------------------------------------------------


On May 21, 2015, 4:28 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 4:28 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Joshua Cohen <jc...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review84837
-----------------------------------------------------------



src/main/python/apache/aurora/client/api/__init__.py
<https://reviews.apache.org/r/34570/#comment136245>

    Do we care that we're going from an immutable to a mutable set with this change (here and elsewhere)?


- Joshua Cohen


On May 21, 2015, 11:28 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 11:28 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Joshua Cohen <jc...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review86879
-----------------------------------------------------------


@ReviewBot retry

- Joshua Cohen


On May 21, 2015, 11:28 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 11:28 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review84825
-----------------------------------------------------------


Master (998993d) is red with this patch.
  ./build-support/jenkins/build.sh

SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/admin/test_admin_util.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/admin/test_maintenance.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/admin/test_admin.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/admin/test_admin_sla.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/admin/util.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_transport.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_cluster_option.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_cluster.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_clusters.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_pex_version.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_shellify.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_aurora_job_key.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/common/test_http_signaler.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/config/test_constraint_parsing.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/config/test_thrift.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/config/test_loader.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/config/test_base.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/test_status_manager.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/test_executor_vars.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/test_executor_base.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/test_thermos_executor.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/test_gc_executor.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/test_thermos_task_runner.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_path_detector.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_announcer.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_kill_manager.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/__init__.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_executor_timeout.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/fixtures.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_health_checker.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_directory_sandbox.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_status_checker.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_resource_manager.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_task_info.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_executor_detector.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/common/test_resource_manager_integration.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/bin/test_thermos_executor_entry_point.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/python/apache/aurora/executor/bin/test_gc_executor_entry_point.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/sh/org/apache/aurora/e2e/http_example.py Everything Looks Good!
SUCCESS: /home/jenkins/jenkins-slave/workspace/AuroraBot/src/test/sh/org/apache/aurora/e2e/validate_serverset.py Everything Looks Good!


I will refresh this build result if you post a review containing "@ReviewBot retry"

- Aurora ReviewBot


On May 21, 2015, 11:28 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 11:28 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Kevin Sweeney <ke...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/
-----------------------------------------------------------

(Updated May 21, 2015, 4:28 p.m.)


Review request for Aurora, Joshua Cohen and Brian Wickman.


Changes
-------

rebase


Repository: aurora


Description
-------

Use Python 2.7 set-literal and set-comprehension syntax where possible.

There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.


Diffs (updated)
-----

  3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
  src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
  src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
  src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
  src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
  src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
  src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
  src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
  src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
  src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
  src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
  src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
  src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
  src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
  src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
  src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
  src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
  src/test/python/apache/aurora/BUILD 0701440ae47034c580b5baae40e5f6feec4bb4fd 
  src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
  src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
  src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
  src/test/python/apache/aurora/client/cli/BUILD 0d85f5fba9d19ae0e9c36546f130b93664b4f6de 
  src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
  src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
  src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
  src/test/python/apache/aurora/thrift_util.py PRE-CREATION 

Diff: https://reviews.apache.org/r/34570/diff/


Testing
-------

I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.

To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).

./pants test.pytest --no-fast src/test/python::


Thanks,

Kevin Sweeney


Re: Review Request 34570: Use set-literals and set-comprehensions where possible

Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34570/#review84818
-----------------------------------------------------------


This patch does not apply cleanly on master (998993d), do you need to rebase?

I will refresh this build result if you post a review containing "@ReviewBot retry"

- Aurora ReviewBot


On May 21, 2015, 11:15 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34570/
> -----------------------------------------------------------
> 
> (Updated May 21, 2015, 11:15 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Brian Wickman.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use Python 2.7 set-literal and set-comprehension syntax where possible.
> 
> There are theoretical performance gains here, for example we now often avoid the creation of an intermediate list. The main reason I did this was consistency though - as you'll see in this review there's no single agreed-upon way to do this.
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt 439554d0980a4f3cd5b65a809547c7ac32d3cbf5 
>   src/main/python/apache/aurora/admin/admin.py d2f7bd13ef335bdca7dc02177c031ac36574658d 
>   src/main/python/apache/aurora/admin/host_maintenance.py c31e2a6fb0348c5e7074e46d61c2d2723afaf14d 
>   src/main/python/apache/aurora/client/api/__init__.py 4b9c48e84bc203fc7b28d7efd0b2e6b8a6f18302 
>   src/main/python/apache/aurora/client/api/instance_watcher.py 6ed815423f48301ecb3faaadcdfa1e46f50b6ca2 
>   src/main/python/apache/aurora/client/api/job_monitor.py aa7e9760d0f4f74a5ddf97e0642bf53efc555644 
>   src/main/python/apache/aurora/client/api/sla.py 5855685bda7188c55432dc6f1ad3c676a38309da 
>   src/main/python/apache/aurora/client/api/updater.py acbce21e991981a2e85c1a00a68e57d88c5509bb 
>   src/main/python/apache/aurora/client/cli/command_hooks.py e95b1b11e16b8e2cfc83ace8654e146be208d14e 
>   src/main/python/apache/aurora/client/cli/context.py c850223588df9d9be4a644aa51adc6419a751af0 
>   src/main/python/apache/aurora/client/cli/jobs.py 5f608419e1235f14836865b46be05d13963deb37 
>   src/main/python/apache/aurora/client/cli/task.py b541d03d6e34dce7f4f1e38e2d970c71c8d94e08 
>   src/main/python/apache/aurora/config/__init__.py dd2f89014a3da730364b14e01c499ac0f2c288c1 
>   src/main/python/apache/aurora/executor/gc_executor.py d4392faf50f8c72f08f951962913248045d7fcb5 
>   src/main/python/apache/thermos/cli/commands/tail.py 47b52eee7cb43a46f75d62b648d293a9c603efc3 
>   src/main/python/apache/thermos/common/planner.py da5120f8f0c2489927a03e9d78ccb4f9b6eb275f 
>   src/main/python/apache/thermos/core/helper.py 8cd32948663a5d5a1e975e1661b78de701710436 
>   src/test/python/apache/aurora/BUILD 885e610a640f96583189d9b0f88c96efff0aa106 
>   src/test/python/apache/aurora/client/api/BUILD 65b378b0b4c5fa11f9899ef04a4a10a211f37245 
>   src/test/python/apache/aurora/client/api/test_job_monitor.py ccc8b551c15df2d726291675a90a62c30ad5ebd4 
>   src/test/python/apache/aurora/client/api/test_sla.py 22b9f995eaa1deae9f5c5467e0939670c099f438 
>   src/test/python/apache/aurora/client/cli/BUILD 5d922965dfbaf2eb0dc938e3d4d13f4cacb49627 
>   src/test/python/apache/aurora/client/cli/test_command_hooks.py 2130f1fa71be02a004cdf8e476a270c81a7105d3 
>   src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
>   src/test/python/apache/aurora/client/cli/test_plugins.py a545fece5e2b3e0017a61e1be9ac478372b1f34d 
>   src/test/python/apache/aurora/thrift_util.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34570/diff/
> 
> 
> Testing
> -------
> 
> I've left most of the tests out of the scope of this review to provide more confidence; however, I've fixed them in a few places where using sets consistently broke things. Specifically I changed construction of some Thrift structs to use set-literals instead of list-literals (since their IDL type is set and not list) and this broke some tests due to a long-standing bug in Thrift.
> 
> To fix them I've introduced a test dependency on [PyHamcrest](http://pyhamcrest.readthedocs.org/en/release-1.8/tutorial/) for matchers support (it's pretty much the same as Java for those who are familiar). Usage of PyHamcrest is [suggested in the mock documentation for this use case](https://docs.python.org/3/library/unittest.mock-examples.html#more-complex-argument-matching).
> 
> ./pants test.pytest --no-fast src/test/python::
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>