Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceVariables: remove unused method #526

Merged
merged 1 commit into from
Nov 29, 2023
Merged
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
28 changes: 0 additions & 28 deletions tdp/core/variables/service_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from tdp.core.variables.variables import Variables, VariablesDict

if TYPE_CHECKING:
from tdp.core.dag import Dag
from tdp.core.repository.repository import Repository
from tdp.core.service_component_name import ServiceComponentName

Expand Down Expand Up @@ -106,33 +105,6 @@ def get_variables(self, component_name: str) -> dict:
with Variables(component_path).open("r") as variables:
return variables.copy()

# TODO: move this function outside of this class, or move the dag part
def get_component_name(self, dag: Dag, component_name: str) -> str:
"""Get the full component name.

Args:
dag: Dag instance.
component_name: Name of the component.

Returns:
<service_name>_<component_name>

Raises:
ValueError: If component does not exist.
"""
operations_filtered = list(
filter(
lambda operation: operation.component == component_name,
dag.services_operations[self.name],
)
)
if operations_filtered:
operation = operations_filtered[0]
return self.name + "_" + operation.component
raise ValueError(
f"Service {self.name} does not have a component {component_name}"
)

def update_from_variables_folder(
self, message: str, tdp_vars_overrides: PathLike
) -> None:
Expand Down
Loading