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

Don't import luigi.worker from __init__.py #438

Merged
merged 1 commit into from
Sep 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions luigi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import configuration
import interface
import target
import worker
import event

Event = worker.Event
Event = event.Event

Task = task.Task
ExternalTask = task.ExternalTask
Expand Down
26 changes: 26 additions & 0 deletions luigi/event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2014 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

class Event:
# TODO nice descriptive subclasses of Event instead of strings? pass their instances to the callback instead of an undocumented arg list?
DEPENDENCY_DISCOVERED = "event.core.dependency.discovered" # triggered for every (task, upstream task) pair discovered in a jobflow
DEPENDENCY_MISSING = "event.core.dependency.missing"
DEPENDENCY_PRESENT = "event.core.dependency.present"
BROKEN_TASK = "event.core.task.broken"
START = "event.core.start"
FAILURE = "event.core.failure"
SUCCESS = "event.core.success"
PROCESSING_TIME = "event.core.processing_time"


15 changes: 2 additions & 13 deletions luigi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import warnings
import notifications
import getpass
import multiprocessing
import multiprocessing # Note: this seems to have some stability issues: https://github.com/spotify/luigi/pull/438
from target import Target
from task import Task
from event import Event

try:
import simplejson as json
Expand All @@ -41,18 +42,6 @@ class TaskException(Exception):
pass


class Event:
# TODO nice descriptive subclasses of Event instead of strings? pass their instances to the callback instead of an undocumented arg list?
DEPENDENCY_DISCOVERED = "event.core.dependency.discovered" # triggered for every (task, upstream task) pair discovered in a jobflow
DEPENDENCY_MISSING = "event.core.dependency.missing"
DEPENDENCY_PRESENT = "event.core.dependency.present"
BROKEN_TASK = "event.core.task.broken"
START = "event.core.start"
FAILURE = "event.core.failure"
SUCCESS = "event.core.success"
PROCESSING_TIME = "event.core.processing_time"


class TaskProcess(multiprocessing.Process):
''' Wrap all task execution in this class.

Expand Down