p1-taskqueue 0.1.7__tar.gz → 0.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of p1-taskqueue might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p1-taskqueue
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: A Task Queue Wrapper for Dekoruma Backend
5
5
  Author-email: Chalvin <engineering@dekoruma.com>
6
6
  Project-URL: Homepage, https://github.com/Dekoruma/p1-taskqueue
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "p1-taskqueue"
7
7
  # DO NOT CHANGE THIS VERSION - it gets automatically replaced by CI/CD with the git tag version
8
- version = "0.1.7"
8
+ version = "0.1.8"
9
9
  description = "A Task Queue Wrapper for Dekoruma Backend"
10
10
  authors = [
11
11
  {name = "Chalvin", email = "engineering@dekoruma.com"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p1-taskqueue
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: A Task Queue Wrapper for Dekoruma Backend
5
5
  Author-email: Chalvin <engineering@dekoruma.com>
6
6
  Project-URL: Homepage, https://github.com/Dekoruma/p1-taskqueue
@@ -58,10 +58,15 @@ def celery_worker_burst(include_func_names: List[str], channel: str = "default")
58
58
  decoded_body) > 1 else {}
59
59
 
60
60
  full_func_name = ""
61
- if task_name.endswith("dynamic_function_executor") and len(task_args) >= 2:
62
- full_func_name = f"{task_args[0]}.{task_args[1]}"
63
- elif task_name.endswith("dynamic_class_method_executor") and len(task_args) >= 3:
64
- full_func_name = f"{task_args[0]}.{task_args[1]}.{task_args[2]}"
61
+ if task_name.endswith("dynamic_function_executor"):
62
+ module_path = task_kwargs.get('module_path', '')
63
+ function_name = task_kwargs.get('function_name', '')
64
+ full_func_name = f"{module_path}.{function_name}"
65
+ elif task_name.endswith("dynamic_class_method_executor"):
66
+ module_path = task_kwargs.get('module_path', '')
67
+ class_name = task_kwargs.get('class_name', '')
68
+ method_name = task_kwargs.get('method_name', '')
69
+ full_func_name = f"{module_path}.{class_name}.{method_name}"
65
70
 
66
71
  should_execute = full_func_name in included_set if full_func_name else False
67
72
 
@@ -65,7 +65,7 @@ class TestCeleryWorkerBurst:
65
65
  mock_message.acknowledged = False
66
66
 
67
67
  mock_loads.return_value = [
68
- ['module.submodule', 'test_function', [], {}], {}]
68
+ [], {'module_path': 'module.submodule', 'function_name': 'test_function', 'args': [], 'kwargs': {}}]
69
69
 
70
70
  mock_queue = MagicMock()
71
71
  mock_queue.get.side_effect = [mock_message, None]
@@ -87,8 +87,8 @@ class TestCeleryWorkerBurst:
87
87
 
88
88
  mock_message.ack.assert_called_once()
89
89
  mock_task.apply.assert_called_once_with(
90
- args=['module.submodule', 'test_function', [], {}],
91
- kwargs={}
90
+ args=[],
91
+ kwargs={'module_path': 'module.submodule', 'function_name': 'test_function', 'args': [], 'kwargs': {}}
92
92
  )
93
93
 
94
94
  @patch('taskqueue.libs.helper_test.current_app')
@@ -107,7 +107,7 @@ class TestCeleryWorkerBurst:
107
107
  mock_message.acknowledged = False
108
108
 
109
109
  mock_loads.return_value = [
110
- ['module.submodule', 'TestClass', 'test_method', [], {}], {}]
110
+ [], {'module_path': 'module.submodule', 'class_name': 'TestClass', 'method_name': 'test_method', 'args': [], 'kwargs': {}, 'init_args': [], 'init_kwargs': {}}]
111
111
 
112
112
  mock_queue = MagicMock()
113
113
  mock_queue.get.side_effect = [mock_message, None]
@@ -129,8 +129,8 @@ class TestCeleryWorkerBurst:
129
129
 
130
130
  mock_message.ack.assert_called_once()
131
131
  mock_task.apply.assert_called_once_with(
132
- args=['module.submodule', 'TestClass', 'test_method', [], {}],
133
- kwargs={}
132
+ args=[],
133
+ kwargs={'module_path': 'module.submodule', 'class_name': 'TestClass', 'method_name': 'test_method', 'args': [], 'kwargs': {}, 'init_args': [], 'init_kwargs': {}}
134
134
  )
135
135
 
136
136
  @patch('taskqueue.libs.helper_test.current_app')
@@ -149,7 +149,7 @@ class TestCeleryWorkerBurst:
149
149
  mock_message.acknowledged = False
150
150
 
151
151
  mock_loads.return_value = [
152
- ['module.submodule', 'other_function', [], {}], {}]
152
+ [], {'module_path': 'module.submodule', 'function_name': 'other_function', 'args': [], 'kwargs': {}}]
153
153
 
154
154
  mock_queue = MagicMock()
155
155
  mock_queue.get.side_effect = [mock_message, None]
@@ -226,7 +226,7 @@ class TestCeleryWorkerBurst:
226
226
  mock_message.acknowledged = False
227
227
 
228
228
  mock_loads.return_value = [
229
- ['module.submodule', 'test_function', [], {}], {}]
229
+ [], {'module_path': 'module.submodule', 'function_name': 'test_function', 'args': [], 'kwargs': {}}]
230
230
 
231
231
  mock_queue = MagicMock()
232
232
  mock_queue.get.side_effect = [mock_message, None]
@@ -271,7 +271,7 @@ class TestCeleryWorkerBurst:
271
271
  lambda self: get_acknowledged())
272
272
 
273
273
  mock_loads.return_value = [
274
- ['module.submodule', 'test_function', [], {}], {}]
274
+ [], {'module_path': 'module.submodule', 'function_name': 'test_function', 'args': [], 'kwargs': {}}]
275
275
 
276
276
  mock_queue = MagicMock()
277
277
  mock_queue.get.side_effect = [mock_message, None]
File without changes
File without changes