Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/next_release/308.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gave worker access to transfer and group names
2 changes: 1 addition & 1 deletion syncmaster/dto/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

@dataclass
class RunDTO:
id: str
id: int
created_at: datetime
5 changes: 3 additions & 2 deletions syncmaster/dto/transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
@dataclass
class TransferDTO:
type: ClassVar[str]
id: int
name: str
group_name: str


@dataclass
class DBTransferDTO(TransferDTO):
id: int
table_name: str
strategy: FullStrategy | IncrementalStrategy
resources: Resources
Expand All @@ -33,7 +35,6 @@ def __post_init__(self):

@dataclass
class FileTransferDTO(TransferDTO):
id: int
directory_path: str
file_format: CSV | JSONLine | JSON | Excel | XML | ORC | Parquet
strategy: FullStrategy | IncrementalStrategy
Expand Down
8 changes: 8 additions & 0 deletions syncmaster/worker/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def __init__(
connection_data=source_connection.data,
run_data={"id": run.id, "created_at": run.created_at},
transfer_id=run.transfer.id,
transfer_name=run.transfer.name,
group_name=run.transfer.group.name,
transfer_params=run.transfer.source_params,
strategy_params=run.transfer.strategy_params,
resources=run.transfer.resources,
Expand All @@ -204,6 +206,8 @@ def __init__(
connection_data=target_connection.data,
run_data={"id": run.id, "created_at": run.created_at},
transfer_id=run.transfer.id,
transfer_name=run.transfer.name,
group_name=run.transfer.group.name,
transfer_params=run.transfer.target_params,
strategy_params=run.transfer.strategy_params,
resources=run.transfer.resources,
Expand Down Expand Up @@ -243,6 +247,8 @@ def get_handler(
connection_auth_data: dict,
run_data: dict[str, Any],
transfer_id: int,
transfer_name: str,
group_name: str,
transfer_params: dict[str, Any],
strategy_params: dict[str, Any],
resources: dict[str, Any],
Expand All @@ -262,6 +268,8 @@ def get_handler(
connection_dto=connection_dto(**connection_data),
transfer_dto=transfer_dto(
id=transfer_id,
name=transfer_name,
group_name=group_name,
strategy=Strategy.from_dict(strategy_params),
resources=Resources(**resources),
transformations=transformations,
Expand Down