Skip to content

Commit 8f42ab7

Browse files
committed
style
1 parent c8af53d commit 8f42ab7

9 files changed

Lines changed: 6 additions & 156 deletions

File tree

src/pydolphinscheduler/cli/tenants.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/pydolphinscheduler/cli/users.py

Whitespace-only changes.

src/pydolphinscheduler/default_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ java_gateway:
3939
default:
4040
# Default value for dolphinscheduler's user object
4141
user:
42-
name: userPythonGateway1
42+
name: userPythonGateway
4343
password: userPythonGateway
4444
email: userPythonGateway@dolphinscheduler.com
45-
tenant: zhongjiajie
45+
tenant: tenant_pydolphin
4646
phone: 11111111111
4747
state: 1
4848
# Default value for dolphinscheduler's workflow object

src/pydolphinscheduler/examples/task_switch_example.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
from pydolphinscheduler.tasks.shell import Shell
3535
from pydolphinscheduler.tasks.switch import Branch, Default, Switch, SwitchCondition
3636

37-
with Workflow(
38-
name="task_switch_example", param={"var": "1"}
39-
) as pd:
37+
with Workflow(name="task_switch_example", param={"var": "1"}) as pd:
4038
parent = Shell(name="parent", command="echo parent")
4139
switch_child_1 = Shell(name="switch_child_1", command="echo switch_child_1")
4240
switch_child_2 = Shell(name="switch_child_2", command="echo switch_child_2")

src/pydolphinscheduler/models/meta.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/pydolphinscheduler/utils/encode.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/core/test_workflow.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from pydolphinscheduler.core.resource import Resource
2929
from pydolphinscheduler.core.workflow import Workflow
3030
from pydolphinscheduler.exceptions import PyDSParamException
31-
from pydolphinscheduler.models import Project, Tenant, User
31+
from pydolphinscheduler.models import Project, User
3232
from pydolphinscheduler.tasks.switch import Branch, Default, Switch, SwitchCondition
3333
from pydolphinscheduler.utils.date import conv_to_schedule
3434
from tests.testing.task import Task
@@ -49,15 +49,14 @@ def test_workflow_key_attr(func):
4949
[
5050
("timezone", configuration.WORKFLOW_TIME_ZONE),
5151
("project", Project(configuration.WORKFLOW_PROJECT)),
52-
("tenant", Tenant(configuration.WORKFLOW_TENANT)),
5352
(
5453
"user",
5554
User(
5655
configuration.USER_NAME,
5756
configuration.USER_PASSWORD,
5857
configuration.USER_EMAIL,
5958
configuration.USER_PHONE,
60-
configuration.WORKFLOW_TENANT,
59+
configuration.USER_TENANT,
6160
configuration.WORKFLOW_QUEUE,
6261
configuration.USER_STATE,
6362
),
@@ -146,7 +145,6 @@ def test_set_release_state_error(value):
146145
"set_attr,set_val,get_attr,get_val",
147146
[
148147
("_project", "project", "project", Project("project")),
149-
("_tenant", "tenant", "tenant", Tenant("tenant")),
150148
("_start_time", "2021-01-01", "start_time", datetime(2021, 1, 1)),
151149
("_end_time", "2021-01-01", "end_time", datetime(2021, 1, 1)),
152150
],
@@ -333,7 +331,6 @@ def test_workflow_get_define_without_task():
333331
"name": TEST_WORKFLOW_NAME,
334332
"description": None,
335333
"project": configuration.WORKFLOW_PROJECT,
336-
"tenant": configuration.WORKFLOW_TENANT,
337334
"workerGroup": configuration.WORKFLOW_WORKER_GROUP,
338335
"warningType": configuration.WORKFLOW_WARNING_TYPE,
339336
"warningGroupId": 0,
@@ -456,31 +453,6 @@ def test_workflow_simple_separate():
456453
assert all(["task-" in task.name for task in pd.task_list])
457454

458455

459-
@pytest.mark.parametrize(
460-
"user_attrs",
461-
[
462-
{"tenant": "tenant_specific"},
463-
],
464-
)
465-
def test_set_workflow_user_attr(user_attrs):
466-
"""Test user with correct attributes if we specific assigned to workflow object."""
467-
default_value = {
468-
"tenant": configuration.WORKFLOW_TENANT,
469-
}
470-
with Workflow(TEST_WORKFLOW_NAME, **user_attrs) as pd:
471-
user = pd.user
472-
for attr in default_value:
473-
# Get assigned attribute if we specific, else get default value
474-
except_attr = (
475-
user_attrs[attr] if attr in user_attrs else default_value[attr]
476-
)
477-
# Get actually attribute of user object
478-
actual_attr = getattr(user, attr)
479-
assert (
480-
except_attr == actual_attr
481-
), f"Except attribute is {except_attr} but get {actual_attr}"
482-
483-
484456
def test_schedule_json_none_schedule():
485457
"""Test function schedule_json with None as schedule."""
486458
with Workflow(

tests/test_configuration.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ def test_get_configs_build_in():
181181
"userPythonGateway@dolphinscheduler.com",
182182
"userPythonGateway@edit.com",
183183
),
184+
("default.user.tenant", "tenant_pydolphin", "edit_tenant_pydolphin"),
184185
("default.user.phone", 11111111111, 22222222222),
185186
("default.user.state", 1, 0),
186187
("default.workflow.project", "project-pydolphin", "eidt-project-pydolphin"),
187-
("default.workflow.tenant", "tenant_pydolphin", "edit_tenant_pydolphin"),
188188
("default.workflow.user", "userPythonGateway", "editUserPythonGateway"),
189189
("default.workflow.queue", "queuePythonGateway", "editQueuePythonGateway"),
190190
("default.workflow.worker_group", "default", "specific"),
@@ -220,7 +220,6 @@ def test_single_config_get_set_not_exists_key():
220220
("USER_PHONE", "11111111111"),
221221
("USER_STATE", 1),
222222
("WORKFLOW_PROJECT", "project-pydolphin"),
223-
("WORKFLOW_TENANT", "tenant_pydolphin"),
224223
("WORKFLOW_USER", "userPythonGateway"),
225224
("WORKFLOW_QUEUE", "queuePythonGateway"),
226225
("WORKFLOW_WORKER_GROUP", "default"),
@@ -249,7 +248,6 @@ def test_get_configuration(config_name: str, expect: Any):
249248
("USER_PHONE", "11111111111", "22222222222"),
250249
("USER_STATE", 1, 0),
251250
("WORKFLOW_PROJECT", "project-pydolphin", "env-project-pydolphin"),
252-
("WORKFLOW_TENANT", "tenant_pydolphin", "env-tenant_pydolphin"),
253251
("WORKFLOW_USER", "userPythonGateway", "envUserPythonGateway"),
254252
("WORKFLOW_QUEUE", "queuePythonGateway", "envQueuePythonGateway"),
255253
("WORKFLOW_WORKER_GROUP", "default", "custom"),

tests/utils/test_yaml_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"default.user.state": (1, 0),
5959
"default.workflow": yaml.load("no need test"),
6060
"default.workflow.project": ("project-pydolphin", "project-pydolphinEdit"),
61-
"default.workflow.tenant": ("tenant_pydolphin", "SmithEdit"),
6261
"default.workflow.user": ("userPythonGateway", "SmithEdit"),
6362
"default.workflow.queue": ("queuePythonGateway", "queueEdit"),
6463
"default.workflow.worker_group": ("default", "wgEdit"),

0 commit comments

Comments
 (0)