repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
rq | rq/results.py | .py | from __future__ import annotations
import zlib
from base64 import b64decode, b64encode
from datetime import datetime, timezone
from enum import Enum
from typing import Any
from redis import Redis
from .defaults import UNSERIALIZABLE_RETURN_VALUE_PAYLOAD
from .job import Job
from .serializers import resolve_serialize... | 326 | 10,973 |
rq | rq/webhook.py | .py | from __future__ import annotations
import json
import logging
from dataclasses import asdict, dataclass
from typing import TYPE_CHECKING, Any, Literal
from urllib.parse import urlparse
from urllib.request import Request, urlopen
if TYPE_CHECKING:
from .job import Job
logger = logging.getLogger('rq.webhook')
@d... | 101 | 3,686 |
rq | rq/logutils.py | .py | from __future__ import annotations
import logging
import sys
from rq.defaults import DEFAULT_LOGGING_DATE_FORMAT, DEFAULT_LOGGING_FORMAT
class _Colorizer:
def __init__(self):
esc = '\x1b['
self.codes = {}
self.codes[''] = ''
self.codes['reset'] = esc + '39;49;00m'
self.... | 163 | 5,163 |
rq | rq/worker_pool.py | .py | from __future__ import annotations
import contextlib
import errno
import logging
import os
import signal
import time
from collections.abc import Iterable
from enum import Enum
from multiprocessing import Process, get_context
from multiprocessing.process import BaseProcess
from typing import TYPE_CHECKING, NamedTuple
f... | 287 | 10,496 |
rq | rq/job_lifecycle.py | .py | from __future__ import annotations
import traceback
from collections.abc import Callable, Iterable
from typing import TYPE_CHECKING
from .job import JobStatus
if TYPE_CHECKING:
from redis.client import Pipeline
from .job import Job
def call_exception_handlers(handlers: Iterable[Callable], job: Job, *exc_i... | 42 | 1,419 |
rq | rq/cli/__main__.py | .py | import sys
from . import main
if __name__ == '__main__':
sys.exit(main())
| 7 | 80 |
rq | rq/cli/cli.py | .py | """
RQ command line tool
"""
import sys
import click
from redis.exceptions import ConnectionError
from rq import Retry
from rq import __version__ as version
from rq.cli.helpers import (
parse_function_args,
parse_schedule,
pass_cli_config,
refresh,
show_both,
show_queues,
show_workers,
)
... | 271 | 8,326 |
rq | rq/cli/helpers.py | .py | import importlib
import os
import sys
import time
from ast import literal_eval
from datetime import datetime, timedelta
from enum import Enum
from functools import partial, update_wrapper
from json import JSONDecodeError, loads
from shutil import get_terminal_size
from typing import cast
import click
from redis import... | 428 | 14,930 |
rq | rq/cli/cli_cron.py | .py | import logging
import logging.config
import sys
import click
from rq.cli.cli import main
from rq.cli.helpers import (
pass_cli_config,
read_config_file,
# setup_loghandlers_from_args is not used when only --logging-level is present
)
from rq.cron import CronScheduler
@main.command()
@click.option(
'... | 54 | 1,534 |
rq | rq/cli/workers.py | .py | import logging
import logging.config
import os
import sys
import warnings
import click
from redis.exceptions import ConnectionError
from rq.cli.cli import main
from rq.cli.helpers import (
import_attribute,
pass_cli_config,
read_config_file,
setup_loghandlers_from_args,
)
from rq.defaults import (
... | 233 | 8,462 |
rq | rq/worker/__init__.py | .py | from ..defaults import DEFAULT_RESULT_TTL
from .base import (
SHUTDOWN_SIGNAL,
DequeueStrategy,
WorkerStatus,
_signames,
logger,
signal_name,
)
from .base import BaseWorker as BaseWorker
from .worker_classes import (
HerokuWorker,
RandomWorker,
RoundRobinWorker,
SimpleWorker,
... | 36 | 640 |
rq | rq/worker/base.py | .py | from __future__ import annotations
import inspect
import logging
import math
import os
import random
import signal
import socket
import sys
import time
import warnings
from collections.abc import Callable, Sequence
from datetime import datetime, timedelta
from enum import Enum
from random import shuffle
from types imp... | 1,739 | 72,669 |
rq | rq/worker/worker_classes.py | .py | from __future__ import annotations
import contextlib
import errno
import os
import signal
import sys
import time
from random import shuffle
from typing import TYPE_CHECKING
from ..connections import get_connection_kwargs
from ..defaults import DEFAULT_WORKER_TTL
from ..exceptions import InvalidJobOperation, ShutDownI... | 317 | 12,588 |
rq | tests/test_cron_job.py | .py | from datetime import datetime, timedelta, timezone
from unittest.mock import patch
from rq import Queue, utils
from rq.cron import CronJob, CronScheduler
from rq.defaults import DEFAULT_CRON_JOB_HISTORY_TTL
from rq.utils import NOT_JSON_SERIALIZABLE
from rq.webhook import Webhook
from tests import RQTestCase
from test... | 471 | 20,536 |
rq | tests/test_spawn_worker.py | .py | import os
import signal
import time
from datetime import timezone
from multiprocessing import Process
from redis import Redis
from rq import Queue
from rq.connections import get_connection_kwargs
from rq.job import Job
from rq.registry import FailedJobRegistry, FinishedJobRegistry
from rq.results import Result
from r... | 179 | 6,590 |
rq | tests/test_queue.py | .py | import json
from datetime import datetime, timedelta, timezone
from unittest.mock import patch
from rq import Queue, Retry
from rq.exceptions import DuplicateJobError
from rq.job import Job, JobStatus
from rq.registry import (
CanceledJobRegistry,
DeferredJobRegistry,
FailedJobRegistry,
FinishedJobRegi... | 949 | 41,337 |
rq | tests/test_connection.py | .py | from redis import ConnectionPool, Redis, SSLConnection, UnixDomainSocketConnection
from rq.connections import parse_connection
from tests import RQTestCase
class TestConnectionInheritance(RQTestCase):
def test_parse_connection(self):
"""Test parsing the connection"""
conn_class, pool_class, pool_... | 20 | 834 |
rq | tests/test_scheduler.py | .py | import os
from datetime import datetime, timedelta, timezone
from multiprocessing import Process
from unittest import mock
import pytest
import redis
from rq import Queue
from rq.defaults import DEFAULT_MAINTENANCE_TASK_INTERVAL
from rq.exceptions import NoSuchJobError, SchedulerNotFound
from rq.job import Job, Retry... | 609 | 28,058 |
rq | tests/test_retry.py | .py | import time
from datetime import datetime, timedelta, timezone
from rq import Queue
from rq.executions import prepare_execution
from rq.job import Job, JobStatus, Retry
from rq.registry import FailedJobRegistry, StartedJobRegistry
from rq.results import Result
from rq.scheduler import RQScheduler
from rq.worker import... | 452 | 18,452 |
rq | tests/test_registry.py | .py | import math
from datetime import timedelta
from unittest import mock
from unittest.mock import ANY
import pytest
from rq.defaults import DEFAULT_FAILURE_TTL
from rq.exceptions import AbandonedJobError, InvalidJobOperation
from rq.executions import Execution
from rq.job import Dependency, Job, JobStatus, requeue_job
f... | 955 | 40,434 |
rq | tests/test_worker_pool.py | .py | import os
import signal
from multiprocessing import Process
from time import sleep
from rq.connections import get_connection_kwargs, parse_connection
from rq.job import JobStatus
from rq.queue import Queue
from rq.serializers import JSONSerializer
from rq.worker import SimpleWorker
from rq.worker_pool import WorkerPoo... | 172 | 7,099 |
rq | tests/__init__.py | .py | import logging
import os
import unittest
import pytest
from redis import Redis
from rq.utils import get_version
def find_empty_redis_database(ssl=False):
"""Tries to connect to a random Redis database (starting from 4), and
will use/connect it when no keys are in there.
"""
for dbnum in range(4, 17)... | 76 | 2,127 |
rq | tests/cron_config.py | .py | from rq import cron
from tests.fixtures import div_by_zero, do_nothing, say_hello
# Define additional test function
def calculate_value(a, b):
"""Function that performs a calculation."""
return a + b
# Register jobs with various configurations
# 1. Basic job that runs every minute
cron.register(say_hello, ... | 29 | 712 |
rq | tests/test_serializers.py | .py | import json
import pickle
import pickletools
import queue
import unittest
from rq.serializers import DefaultSerializer, JSONSerializer, PickleSerializer, resolve_serializer
class TestSerializers(unittest.TestCase):
def test_resolve_serializer(self):
"""Ensure function resolve_serializer works correctly""... | 48 | 1,833 |
rq | tests/test_scripts.py | .py | """Tests for rq.scripts functions."""
import calendar
from datetime import datetime, timedelta, timezone
from rq import Queue
from rq.exceptions import DuplicateJobError
from rq.job import Job, JobStatus
from rq.scripts import save_unique_job, schedule_unique_job
from tests import RQTestCase
from tests.fixtures impor... | 203 | 8,849 |
rq | tests/test_webhooks.py | .py | import json
from datetime import datetime, timedelta, timezone
from unittest.mock import ANY, patch
from rq.job import Job, JobStatus, Retry
from rq.queue import Queue
from rq.registry import StartedJobRegistry
from rq.webhook import Webhook
from rq.worker import SimpleWorker
from tests import RQTestCase
from .fixtur... | 373 | 17,062 |
rq | tests/fixtures.py | .py | """
This file contains all jobs that are used in tests. Each of these test
fixtures has a slightly different characteristics.
"""
from __future__ import annotations
import os
import signal
import subprocess
import sys
import time
from multiprocessing import Process
from redis import Redis
from rq import Queue, get... | 376 | 10,227 |
rq | tests/test_cron_scheduler_registry.py | .py | import time
from rq import cron_scheduler_registry
from rq.cron import CronScheduler
from rq.exceptions import DuplicateSchedulerError, SchedulerNotFound
from tests import RQTestCase
class TestCronSchedulerRegistry(RQTestCase):
"""Tests for the cron scheduler registry functions"""
def setUp(self):
s... | 111 | 4,503 |
rq | tests/test_job_dependency.py | .py | import time
from datetime import timedelta
from unittest import mock
from redis import WatchError
from rq.connections import get_connection_kwargs
from rq.job import Dependency, Job, JobStatus, cancel_job
from rq.queue import Queue
from rq.registry import (
CanceledJobRegistry,
)
from rq.serializers import JSONSe... | 591 | 28,536 |
rq | tests/test_intermediate_queue.py | .py | from datetime import datetime, timedelta, timezone
from unittest.mock import patch
import pytest
from rq import Queue, Worker
from rq.intermediate_queue import IntermediateQueue
from rq.job import JobStatus
from rq.maintenance import clean_intermediate_queue
from tests import RQTestCase, min_redis_version
from tests.... | 220 | 10,857 |
rq | tests/test_decorator.py | .py | from unittest import mock
from rq.decorators import job
from rq.job import Job, Retry
from rq.queue import Queue
from rq.webhook import Webhook
from rq.worker import DEFAULT_RESULT_TTL
from tests import RQTestCase
class TestDecorator(RQTestCase):
def setUp(self):
super().setUp()
@job(queue='defa... | 274 | 9,379 |
rq | tests/test_job_lifecycle.py | .py | import sys
import traceback
from unittest import mock
from rq.job import JobStatus
from rq.job_lifecycle import call_exception_handlers, format_exc_info, record_job_failure
from rq.queue import Queue
from rq.registry import FailedJobRegistry
from tests import RQTestCase
from tests.fixtures import say_hello
class Job... | 60 | 2,531 |
rq | tests/test_dependencies.py | .py | from multiprocessing import Process
from rq import Queue, SimpleWorker, Worker
from rq.connections import get_connection_kwargs
from rq.job import Dependency, Job, JobStatus
from rq.utils import current_timestamp
from tests import RQTestCase
from tests.fixtures import check_dependencies_are_met, div_by_zero, kill_hors... | 310 | 13,873 |
rq | tests/test_queue_unique.py | .py | """Tests for Queue unique job enqueue behavior."""
from datetime import datetime, timedelta, timezone
from rq import Queue
from rq.exceptions import DuplicateJobError
from rq.job import JobStatus
from rq.rate_limit import RateLimit
from tests import RQTestCase
from tests.fixtures import say_hello
class TestEnqueueJ... | 76 | 3,013 |
rq | tests/test_callbacks.py | .py | from datetime import timedelta
from unittest import mock
from rq import Queue, Worker
from rq.job import UNEVALUATED, Callback, Job, JobStatus
from rq.serializers import JSONSerializer
from rq.worker import SimpleWorker
from tests import RQTestCase
from tests.fixtures import (
div_by_zero,
erroneous_callback,
... | 390 | 17,382 |
rq | tests/test_repeat.py | .py | from datetime import timedelta
from rq import Queue, Worker
from rq.job import Job
from rq.registry import ScheduledJobRegistry
from rq.repeat import Repeat
from rq.utils import now
from tests import RQTestCase
from tests.fixtures import div_by_zero, say_hello
class TestRepeat(RQTestCase):
"""Tests for the Repea... | 225 | 8,328 |
rq | tests/test_cron.py | .py | import json
import os
import signal
import socket
import tempfile
import time
from datetime import datetime, timedelta, timezone
from multiprocessing import Process
from typing import cast
from unittest.mock import patch
from redis import Redis
from rq import Queue, cron, utils
from rq.connections import get_connecti... | 943 | 42,191 |
rq | tests/test_group.py | .py | from time import sleep
import pytest
from rq import Queue, SimpleWorker
from rq.exceptions import NoSuchGroupError
from rq.group import Group
from rq.job import Job
from rq.utils import as_text
from tests import RQTestCase
from tests.fixtures import say_hello
class TestGroup(RQTestCase):
job_1_data = Queue.prep... | 161 | 6,660 |
rq | tests/test_rate_limit.py | .py | from datetime import datetime
from rq.exceptions import InvalidJobOperation
from rq.executions import Execution
from rq.job import Job, JobStatus, Retry
from rq.queue import Queue
from rq.rate_limit import RateLimit, RateLimitRegistry
from rq.registry import ScheduledJobRegistry, StartedJobRegistry
from rq.scheduler i... | 828 | 41,325 |
rq | tests/test_timeouts.py | .py | import time
from unittest.mock import patch
from rq import Queue, SimpleWorker
from rq.registry import FailedJobRegistry, FinishedJobRegistry
from rq.timeouts import (
TimerDeathPenalty,
UnixSignalDeathPenalty,
get_default_death_penalty_class,
)
from tests import RQTestCase
class TimerBasedWorker(SimpleW... | 71 | 2,731 |
rq | tests/test_commands.py | .py | import time
from multiprocessing import Process
from unittest import mock
from redis import Redis
from redis.exceptions import ResponseError
from rq import Queue, Worker
from rq.command import (
send_command,
send_kill_horse_command,
send_shutdown_command,
send_stop_execution_command,
send_stop_jo... | 170 | 6,315 |
rq | tests/test_results.py | .py | import tempfile
import time
from datetime import timedelta
from rq.defaults import UNSERIALIZABLE_RETURN_VALUE_PAYLOAD
from rq.executions import prepare_execution
from rq.job import Job, Retry
from rq.queue import Queue
from rq.registry import StartedJobRegistry
from rq.results import Result, get_key
from rq.utils imp... | 335 | 13,712 |
rq | tests/test_worker.py | .py | import json
import multiprocessing
import os
import shutil
import signal
import subprocess
import sys
import threading
import time
import zlib
from datetime import datetime, timedelta, timezone
from multiprocessing import Process
from time import sleep
from unittest import mock, skipIf
from unittest.mock import Mock
i... | 1,901 | 77,580 |
rq | tests/test_worker_registration.py | .py | from unittest.mock import patch
from rq import Queue, Worker
from rq.utils import ceildiv
from rq.worker_registration import (
REDIS_WORKER_KEYS,
WORKERS_BY_QUEUE_KEY,
clean_worker_registry,
get_keys,
register,
unregister,
)
from tests import RQTestCase
class TestWorkerRegistry(RQTestCase):
... | 104 | 4,352 |
rq | tests/test_cli.py | .py | import json
import logging
import os
from datetime import datetime, timedelta, timezone
from time import sleep
from unittest.mock import MagicMock, patch
from uuid import uuid4
import pytest
from click.testing import CliRunner
from redis import Redis
from rq import Queue
from rq.cli import main
from rq.cli.helpers im... | 1,053 | 43,107 |
rq | tests/test_executions.py | .py | from datetime import timedelta
from time import sleep
from unittest.mock import patch
from rq.executions import Execution, ExecutionRegistry
from rq.job import Job
from rq.queue import Queue
from rq.utils import as_text, current_timestamp, now
from rq.worker import SimpleWorker, Worker
from tests import RQTestCase
fro... | 347 | 16,541 |
rq | tests/test_helpers.py | .py | from unittest import mock
from rq.cli.helpers import get_redis_from_config
from tests import RQTestCase
class TestHelpers(RQTestCase):
@mock.patch('rq.cli.helpers.Sentinel')
def test_get_redis_from_config(self, sentinel_class_mock):
"""Ensure Redis connection params are properly parsed"""
set... | 90 | 3,336 |
rq | tests/test_fixtures.py | .py | from rq import Queue
from rq.connections import get_connection_kwargs
from tests import RQTestCase, fixtures
class TestFixtures(RQTestCase):
def test_rpush_fixture(self):
connection_kwargs = get_connection_kwargs(self.connection)
fixtures.rpush('foo', 'bar', connection_kwargs)
assert self.... | 18 | 680 |
rq | tests/test_utils.py | .py | import datetime
import os
import sys
from unittest.mock import Mock, patch
from redis import Redis
from rq.exceptions import TimeoutFormatError
from rq.job import Job
from rq.queue import Queue
from rq.utils import (
Platform,
as_text,
backend_class,
ceildiv,
decode_redis_hash,
ensure_job_list... | 413 | 17,148 |
rq | tests/test_job.py | .py | import json
import queue
import time
import zlib
from datetime import datetime, timezone
from pickle import dumps, loads
from uuid import uuid4
from rq.defaults import CALLBACK_TIMEOUT
from rq.exceptions import DeserializationError, InvalidJobOperation, NoSuchJobError
from rq.executions import Execution
from rq.job im... | 905 | 36,278 |
rq | tests/config_files/dummy_logging.py | .py | # example config taken from <https://stackoverflow.com/a/7507842/784804>
DICT_CONFIG = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {'format': 'MY_LOG_FMT: %(asctime)s [%(levelname)s] %(name)s: %(message)s'},
},
'handlers': {
'default': {
... | 20 | 625 |
rq | tests/config_files/dummy_override.py | .py | REDIS_HOST = 'testhost.example.com'
REDIS_PORT = 6378
REDIS_DB = 2
REDIS_PASSWORD = '123'
| 5 | 90 |
rq | examples/run_example.py | .py | import os
import time
from fib import slow_fib
from redis import Redis
from rq import Queue
from rq.job import JobStatus
def enqueue(connection):
# Range of Fibonacci numbers to compute
fib_range = range(20, 34)
# Kick off the tasks asynchronously
q = Queue(connection=connection)
jobs = [q.enqu... | 50 | 1,236 |
rq | examples/fib.py | .py | def slow_fib(n):
if n <= 1:
return 1
else:
return slow_fib(n - 1) + slow_fib(n - 2)
| 6 | 108 |
luigi | luigi/task_history.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 80 | 1,989 |
luigi | luigi/parameter.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 1,855 | 61,552 |
luigi | luigi/server.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 380 | 14,507 |
luigi | luigi/process.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 121 | 3,446 |
luigi | luigi/notifications.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 430 | 14,835 |
luigi | luigi/format.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 496 | 14,437 |
luigi | luigi/task_status.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 29 | 892 |
luigi | luigi/retcodes.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2015-2015 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... | 112 | 4,347 |
luigi | luigi/scheduler.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 1,674 | 65,972 |
luigi | luigi/util.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 472 | 16,371 |
luigi | luigi/rpc.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 197 | 6,736 |
luigi | luigi/date_interval.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 266 | 8,608 |
luigi | luigi/db_task_history.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 284 | 11,525 |
luigi | luigi/__init__.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 158 | 4,070 |
luigi | luigi/execution_summary.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2015-2015 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... | 507 | 20,201 |
luigi | luigi/worker.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 1,284 | 51,163 |
luigi | luigi/__version__.py | .py | # coding: utf-8
VERSION = "3.8.1"
| 4 | 35 |
luigi | luigi/event.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 37 | 1,757 |
luigi | luigi/task_register.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 257 | 8,071 |
luigi | luigi/freezing.py | .py | """Internal-only module with immutable data structures.
Please, do not use it outside of Luigi codebase itself.
"""
from collections import OrderedDict
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping # type: ignore
import functools
import operator
class FrozenO... | 70 | 2,138 |
luigi | luigi/batch_notifier.py | .py | """
Library for sending batch notifications from the Luigi scheduler. This module
is internal to Luigi and not designed for use in other contexts.
"""
import collections
import time
from datetime import datetime
import luigi
import luigi.parameter
import luigi.task
from luigi.notifications import email, send_email
... | 208 | 8,797 |
luigi | luigi/setup_logging.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2018 Vote Inc.
#
# 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 ag... | 173 | 5,734 |
luigi | luigi/cmdline_parser.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2015 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 a... | 148 | 5,159 |
luigi | luigi/metrics.py | .py | import abc
import importlib
from enum import Enum
class MetricsCollectors(Enum):
custom = -1
default = 1
none = 1
datadog = 2
prometheus = 3
@classmethod
def get(cls, which, custom_import=None):
if which == MetricsCollectors.none:
return NoMetricsCollector()
el... | 97 | 2,582 |
luigi | luigi/cmdline.py | .py | import argparse
import sys
from luigi.retcodes import run_with_retcodes
from luigi.setup_logging import DaemonLogging
def luigi_run(argv=sys.argv[1:]):
run_with_retcodes(argv)
def luigid(argv=sys.argv[1:]):
import luigi.configuration
import luigi.process
import luigi.server
parser = argparse.A... | 39 | 1,370 |
luigi | luigi/task.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 1,033 | 36,723 |
luigi | luigi/mock.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 183 | 5,679 |
luigi | luigi/local_target.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 191 | 6,185 |
luigi | luigi/target.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 358 | 12,753 |
luigi | luigi/interface.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 211 | 8,864 |
luigi | luigi/lock.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 159 | 5,366 |
luigi | luigi/mypy.py | .py | """Plugin that provides support for luigi.Task
This Code reuses the code from mypy.plugins.dataclasses
https://github.com/python/mypy/blob/0753e2a82dad35034e000609b6e8daa37238bfaa/mypy/plugins/dataclasses.py
"""
from __future__ import annotations
from typing import Callable, Dict, Final, Iterator, List, Literal, Opt... | 506 | 20,313 |
luigi | luigi/safe_extractor.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 98 | 3,567 |
luigi | luigi/tools/luigi_grep.py | .py | #!/usr/bin/env python
import argparse
import json
from collections import defaultdict
from urllib.request import urlopen
class LuigiGrep:
def __init__(self, host, port):
self._host = host
self._port = port
@property
def graph_url(self):
return "http://{0}:{1}/api/graph".format(se... | 79 | 2,779 |
luigi | luigi/tools/deps_tree.py | .py | # -*- coding: utf-8 -*-
"""
This module parses commands exactly the same as the luigi task runner. You must specify the module, the task and task parameters.
Instead of executing a task, this module prints the significant parameters and state of the task and its dependencies in a tree format.
Use this to visualize the ... | 77 | 2,568 |
luigi | luigi/tools/deps.py | .py | #!/usr/bin/env python
# Finds all tasks and task outputs on the dependency paths from the given downstream task T
# up to the given source/upstream task S (optional). If the upstream task is not given,
# all upstream tasks on all dependency paths of T will be returned.
# Terms:
# if the execution of Task T depends ... | 133 | 4,689 |
luigi | luigi/tools/range.py | .py | # -*- coding: utf-8 -*-
# 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... | 790 | 33,551 |
luigi | luigi/configuration/base_parser.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 42 | 1,305 |
luigi | luigi/configuration/toml_parser.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2018 Vote Inc.
#
# 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 ag... | 98 | 2,917 |
luigi | luigi/configuration/cfg_parser.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 209 | 8,274 |
luigi | luigi/configuration/core.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 87 | 2,641 |
luigi | luigi/contrib/mrrunner.py | .py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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 requ... | 97 | 2,806 |
luigi | luigi/contrib/azureblob.py | .py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Microsoft Corporation
#
# 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 appl... | 321 | 13,932 |
luigi | luigi/contrib/hadoop.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | 1,036 | 37,108 |
luigi | luigi/contrib/external_daily_snapshot.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2017 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... | 79 | 2,380 |
luigi | luigi/contrib/batch.py | .py | # -*- coding: utf-8 -*-
#
# Copyright 2018 Outlier Bio, LLC
#
# 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 la... | 205 | 7,790 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.