Repository: m3dev/gokart

Issue:
Default path for make_large_data_frame_target
In the same manner as `output()`、it might be great if `make_large_data_frame_target()` can produce default path.

```
        file_path = self.__module__.replace('.', '/')
        return self.make_large_data_frame_target(os.path.join(file_path, f'{type(self).__name__}.zip'))
```

Comments:

Patch:
diff --git a/gokart/redis_lock.py b/gokart/redis_lock.py
index d371b67..a287fd0 100644
--- a/gokart/redis_lock.py
+++ b/gokart/redis_lock.py
@@ -11,11 +11,11 @@ logger = getLogger(__name__)
 
 
 class RedisParams(NamedTuple):
-    redis_host: str = None
-    redis_port: str = None
-    redis_timeout: int = None
-    redis_key: str = None
-    should_redis_lock: bool = 180
+    redis_host: str
+    redis_port: str
+    redis_timeout: int
+    redis_key: str
+    should_redis_lock: bool
 
 
 class RedisClient:
diff --git a/gokart/target.py b/gokart/target.py
index dc2cad1..c9d890c 100644
--- a/gokart/target.py
+++ b/gokart/target.py
@@ -77,7 +77,7 @@ class SingleFileTarget(TargetOnKart):
             self,
             target: luigi.target.FileSystemTarget,
             processor: FileProcessor,
-            redis_params: RedisParams = RedisParams(),
+            redis_params: RedisParams,
     ) -> None:
         self._target = target
         self._processor = processor
@@ -115,7 +115,7 @@ class ModelTarget(TargetOnKart):
             temporary_directory: str,
             load_function,
             save_function,
-            redis_params: RedisParams = RedisParams(),
+            redis_params: RedisParams,
     ) -> None:
         self._zip_client = make_zip_client(file_path, temporary_directory)
         self._temporary_directory = temporary_directory
diff --git a/gokart/task.py b/gokart/task.py
index 4aa99b2..15b3b62 100644
--- a/gokart/task.py
+++ b/gokart/task.py
@@ -61,8 +61,7 @@ class TaskOnKart(luigi.Task):
         self._rerun_state = self.rerun
 
     def output(self):
-        file_path = self.__module__.replace(".", "/")
-        return self.make_target(os.path.join(file_path, f"{type(self).__name__}.pkl"))
+        return self.make_target()
 
     def requires(self):
         tasks = self.make_task_instance_dictionary()
@@ -131,8 +130,10 @@ class TaskOnKart(luigi.Task):
 
         return cls(**new_k)
 
-    def make_target(self, relative_file_path: str, use_unique_id: bool = True, processor: Optional[FileProcessor] = None) -> TargetOnKart:
-        file_path = os.path.join(self.workspace_directory, relative_file_path)
+    def make_target(self, relative_file_path: str = None, use_unique_id: bool = True, processor: Optional[FileProcessor] = None) -> TargetOnKart:
+        formatted_relative_file_path = relative_file_path if relative_file_path is not None else os.path.join(self.__module__.replace(".", "/"),
+                                                                                                              f"{type(self).__name__}.pkl")
+        file_path = os.path.join(self.workspace_directory, formatted_relative_file_path)
         unique_id = self.make_unique_id() if use_unique_id else None
         return gokart.target.make_target(file_path=file_path,
                                          unique_id=unique_id,
@@ -141,8 +142,10 @@ class TaskOnKart(luigi.Task):
                                          redis_port=self.redis_port,
                                          redis_timeout=self.redis_timeout)
 
-    def make_large_data_frame_target(self, relative_file_path: str, use_unique_id: bool = True, max_byte=int(2**26)) -> TargetOnKart:
-        file_path = os.path.join(self.workspace_directory, relative_file_path)
+    def make_large_data_frame_target(self, relative_file_path: str = None, use_unique_id: bool = True, max_byte=int(2**26)) -> TargetOnKart:
+        formatted_relative_file_path = relative_file_path if relative_file_path is not None else os.path.join(self.__module__.replace(".", "/"),
+                                                                                                              f"{type(self).__name__}.zip")
+        file_path = os.path.join(self.workspace_directory, formatted_relative_file_path)
         unique_id = self.make_unique_id() if use_unique_id else None
         return gokart.target.make_model_target(file_path=file_path,
                                                temporary_directory=self.local_temporary_directory,


Test patch:
diff --git a/test/test_task_on_kart.py b/test/test_task_on_kart.py
index 6b5a118..b1f4d10 100644
--- a/test/test_task_on_kart.py
+++ b/test/test_task_on_kart.py
@@ -153,6 +153,12 @@ class TaskTest(unittest.TestCase):
         self.assertIsInstance(default_target, SingleFileTarget)
         self.assertEqual(f'./resources/test/test_task_on_kart/_DummyTaskD_{task.task_unique_id}.pkl', default_target._target.path)
 
+    def test_default_large_dataframe_target(self):
+        task = _DummyTaskD()
+        default_large_dataframe_target = task.make_large_data_frame_target()
+        self.assertIsInstance(default_large_dataframe_target, ModelTarget)
+        self.assertEqual(f'./resources/test/test_task_on_kart/_DummyTaskD_{task.task_unique_id}.zip', default_large_dataframe_target._zip_client._file_path)
+
     def test_make_target(self):
         task = _DummyTask()
         target = task.make_target('test.txt')