Skip to content

Commit a4dee26

Browse files
marashkaMarat Akhmetov
andauthored
[DOP-28176] Give worker access to transfer and group names (#308)
* [DOP-28176] syncmster-datatrentgen integration * [DOP-28176] Gave worker access to transfer and group names --------- Co-authored-by: Marat Akhmetov <ahmetovmr@mts.ru>
1 parent 5f816a6 commit a4dee26

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gave worker access to transfer and group names

syncmaster/dto/runs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
@dataclass
88
class RunDTO:
9-
id: str
9+
id: int
1010
created_at: datetime

syncmaster/dto/transfers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
@dataclass
1515
class TransferDTO:
1616
type: ClassVar[str]
17+
id: int
18+
name: str
19+
group_name: str
1720

1821

1922
@dataclass
2023
class DBTransferDTO(TransferDTO):
21-
id: int
2224
table_name: str
2325
strategy: FullStrategy | IncrementalStrategy
2426
resources: Resources
@@ -33,7 +35,6 @@ def __post_init__(self):
3335

3436
@dataclass
3537
class FileTransferDTO(TransferDTO):
36-
id: int
3738
directory_path: str
3839
file_format: CSV | JSONLine | JSON | Excel | XML | ORC | Parquet
3940
strategy: FullStrategy | IncrementalStrategy

syncmaster/worker/controller.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ def __init__(
193193
connection_data=source_connection.data,
194194
run_data={"id": run.id, "created_at": run.created_at},
195195
transfer_id=run.transfer.id,
196+
transfer_name=run.transfer.name,
197+
group_name=run.transfer.group.name,
196198
transfer_params=run.transfer.source_params,
197199
strategy_params=run.transfer.strategy_params,
198200
resources=run.transfer.resources,
@@ -204,6 +206,8 @@ def __init__(
204206
connection_data=target_connection.data,
205207
run_data={"id": run.id, "created_at": run.created_at},
206208
transfer_id=run.transfer.id,
209+
transfer_name=run.transfer.name,
210+
group_name=run.transfer.group.name,
207211
transfer_params=run.transfer.target_params,
208212
strategy_params=run.transfer.strategy_params,
209213
resources=run.transfer.resources,
@@ -243,6 +247,8 @@ def get_handler(
243247
connection_auth_data: dict,
244248
run_data: dict[str, Any],
245249
transfer_id: int,
250+
transfer_name: str,
251+
group_name: str,
246252
transfer_params: dict[str, Any],
247253
strategy_params: dict[str, Any],
248254
resources: dict[str, Any],
@@ -262,6 +268,8 @@ def get_handler(
262268
connection_dto=connection_dto(**connection_data),
263269
transfer_dto=transfer_dto(
264270
id=transfer_id,
271+
name=transfer_name,
272+
group_name=group_name,
265273
strategy=Strategy.from_dict(strategy_params),
266274
resources=Resources(**resources),
267275
transformations=transformations,

0 commit comments

Comments
 (0)