Skip to content

Commit 5395556

Browse files
authored
Merge branch 'master' into introduce-polars
2 parents 8a9063f + 68fa264 commit 5395556

File tree

8 files changed

+33
-10
lines changed

8 files changed

+33
-10
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
platform: ["ubuntu-latest"]
1515
tox-env: ["py39", "py310", "py311", "py312", "py313"]
1616
include:
17-
# test only on latest python for macos
1817
- platform: macos-13
1918
tox-env: "py313"
2019
- platform: macos-latest

docs/for_pandas.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Please refer to :func:`~gokart.task.TaskOnKart.load`.
5353
Fail on empty DataFrame
5454
-----------------------
5555

56-
When the :attr:`~gokart.task.TaskOnKart.fail_on_empty_dump` parameter is true, the :func:`~gokart.task.TaskOnKart.dump()` method raises :class:`~gokart.task.EmptyDumpError` on trying to dump empty ``pandas.DataFrame``.
56+
When the :attr:`~gokart.task.TaskOnKart.fail_on_empty_dump` parameter is true, the :func:`~gokart.task.TaskOnKart.dump()` method raises :class:`~gokart.errors.EmptyDumpError` on trying to dump empty ``pandas.DataFrame``.
5757

5858

5959
.. code:: python

gokart/build.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ def __exit__(self, exception_type, exception_value, traceback):
4141

4242

4343
class GokartBuildError(Exception):
44-
def __init__(self, messsage, raised_exceptions: dict[str, list[Exception]]):
45-
super().__init__(messsage)
44+
"""Raised when ``gokart.build`` failed. This exception contains raised exceptions in the task execution."""
45+
46+
def __init__(self, message, raised_exceptions: dict[str, list[Exception]]):
47+
super().__init__(message)
4648
self.raised_exceptions = raised_exceptions
4749

4850

4951
class HasLockedTaskException(Exception):
50-
pass
52+
"""Raised when the task failed to acquire the lock in the task execution."""
5153

5254

5355
class TaskLockExceptionRaisedFlag:

gokart/conflict_prevention_lock/task_lock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class TaskLockParams(NamedTuple):
2323

2424
class TaskLockException(Exception):
2525
pass
26+
"""Raised when the task failed to acquire the lock in the task execution. Only used internally."""
2627

2728

2829
class RedisClient:

gokart/errors/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from gokart.build import GokartBuildError, HasLockedTaskException
2+
from gokart.pandas_type_config import PandasTypeError
3+
from gokart.task import EmptyDumpError
4+
5+
__all__ = [
6+
'GokartBuildError',
7+
'HasLockedTaskException',
8+
'PandasTypeError',
9+
'EmptyDumpError',
10+
]

gokart/pandas_type_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class PandasTypeError(Exception):
16-
pass
16+
"""Raised when the type of the pandas DataFrame column is not as expected."""
1717

1818

1919
class PandasTypeConfig(luigi.Config):

gokart/slack/__init__.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
from gokart.slack.event_aggregator import EventAggregator # noqa:F401
2-
from gokart.slack.slack_api import SlackAPI # noqa:F401
3-
from gokart.slack.slack_config import SlackConfig # noqa:F401
1+
from gokart.slack.event_aggregator import EventAggregator
2+
from gokart.slack.slack_api import SlackAPI
3+
from gokart.slack.slack_config import SlackConfig
4+
5+
from .slack_api import ChannelListNotLoadedError, ChannelNotFoundError, FileNotUploadedError
6+
7+
__all__ = [
8+
'ChannelListNotLoadedError',
9+
'ChannelNotFoundError',
10+
'FileNotUploadedError',
11+
'EventAggregator',
12+
'SlackAPI',
13+
'SlackConfig',
14+
]

gokart/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# NOTE: inherited from AssertionError for backward compatibility (Formerly, Gokart raises that exception when a task dumps an empty DataFrame).
3737
class EmptyDumpError(AssertionError):
38-
"""Attempted to dump an empty DataFrame even though it is prohibited (fail_on_empty_dump is set to True)."""
38+
"""Raised when the task attempts to dump an empty DataFrame even though it is prohibited (``fail_on_empty_dump`` is set to True)"""
3939

4040

4141
class TaskOnKart(luigi.Task, Generic[T]):

0 commit comments

Comments
 (0)