-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Make luigi package more flake8 compliant #1175
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
# | ||
|
||
import time | ||
import datetime | ||
from helpers import unittest | ||
|
||
from nose.plugins.attrib import attr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
# limitations under the License. | ||
# | ||
|
||
import os | ||
import os # NOQA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ | |
|
||
from __future__ import absolute_import | ||
|
||
import os | ||
import os # NOQA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,8 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
import mock | ||
from helpers import unittest, LuigiTestCase | ||
|
||
from luigi import six | ||
from helpers import LuigiTestCase | ||
|
||
import luigi | ||
import luigi.worker | ||
|
@@ -76,7 +74,12 @@ def requires(self): | |
s = self.summary() | ||
self.assertIn('\n* 3 ran successfully:\n - 3 Bar(num=', s) | ||
self.assertIn('\n* 1 present dependencies were encountered:\n - 1 Bar(num=1)\n', s) | ||
self.assertIn('\n* 1 failed:\n - 1 Bar(num=0)\n* 1 were left pending, among these:\n * 1 had failed dependencies:\n - 1 Foo()\n\nThis progress looks :( because there were failed tasks', s) | ||
self.assertIn('\n* 1 failed:\n' | ||
' - 1 Bar(num=0)\n' | ||
'* 1 were left pending, among these:\n' | ||
' * 1 had failed dependencies:\n' | ||
' - 1 Foo()\n\n' | ||
'This progress looks :( because there were failed tasks', s) | ||
self.assertNotIn('\n\n\n', s) | ||
|
||
def test_upstream_not_running(self): | ||
|
@@ -118,7 +121,11 @@ def requires(self): | |
self.assertIn('\n* 4 ran successfully:\n - 4 Bar(num=1...4)\n', s) | ||
self.assertIn('\n* 1 failed:\n - 1 Bar(num=0)\n', s) | ||
self.assertIn('\n* 5 were left pending, among these:\n * 4 were missing external dependencies:\n - 4 ExternalBar(num=', s) | ||
self.assertIn('\n * 1 had failed dependencies:\n - 1 Foo()\n * 1 had missing external dependencies:\n - 1 Foo()\n\nThis progress looks :( because there were failed tasks\n', s) | ||
self.assertIn('\n * 1 had failed dependencies:\n' | ||
' - 1 Foo()\n' | ||
' * 1 had missing external dependencies:\n' | ||
' - 1 Foo()\n\n' | ||
'This progress looks :( because there were failed tasks\n', s) | ||
self.assertNotIn('\n\n\n', s) | ||
|
||
def test_already_running(self): | ||
|
@@ -166,8 +173,17 @@ def run(self): | |
self.assertEqual({LockTask()}, d['run_by_other_worker']) | ||
self.assertEqual({ParentTask()}, d['upstream_run_by_other_worker']) | ||
s = self.summary() | ||
self.assertIn('\nScheduled 2 tasks of which:\n* 2 were left pending, among these:\n * 1 were being run by another worker:\n - 1 LockTask()\n * 1 had dependencies that were being run by other worker:\n - 1 ParentTask()\n', s) | ||
self.assertIn('\n\nThe other workers were:\n - other_worker ran 1 tasks\n\nDid not run any tasks\nThis progress looks :) because there were no failed tasks or missing external dependencies\n', s) | ||
self.assertIn('\nScheduled 2 tasks of which:\n' | ||
'* 2 were left pending, among these:\n' | ||
' * 1 were being run by another worker:\n' | ||
' - 1 LockTask()\n' | ||
' * 1 had dependencies that were being run by other worker:\n' | ||
' - 1 ParentTask()\n', s) | ||
self.assertIn('\n\nThe other workers were:\n' | ||
' - other_worker ran 1 tasks\n\n' | ||
'Did not run any tasks\n' | ||
'This progress looks :) because there were no failed ' | ||
'tasks or missing external dependencies\n', s) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah this looks so much nicer! :) |
||
self.assertNotIn('\n\n\n', s) | ||
|
||
def test_larger_tree(self): | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought
\
were unpythonic and one preferred parenthesis? No?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there is no more or less pythonic. In my opinion - pythonic mean better readable.
In some cases parenthesis better readable but in this case - this condition
\
looks good. Condition must no be over-parenthesised.https://www.python.org/dev/peps/pep-0008/#maximum-line-length