Skip to content

Commit

Permalink
fix terminate import that lead to import error (circular import)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurprevot committed Dec 1, 2024
1 parent bd94533 commit 0da9b77
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
18 changes: 9 additions & 9 deletions yaetos/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,15 @@ def convert_to_linux_eol_if_needed(fname):
convert_to_linux_eol(fname, fname)


def terminate(error_message=None):
"""
Method to exit the Python script. It will log the given message and then exit().
:param error_message:
"""
if error_message:
logger.error(error_message)
logger.critical('The script is now terminating')
exit()
# def terminate(error_message=None):
# """
# Method to exit the Python script. It will log the given message and then exit().
# :param error_message:
# """
# if error_message:
# logger.error(error_message)
# logger.critical('The script is now terminating')
# exit()


def deploy_standalone(job_args_update={}):
Expand Down
2 changes: 1 addition & 1 deletion yaetos/deploy_airflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path as Pt
from cloudpathlib import CloudPath as CPt
from yaetos.deploy_k8s import Kuberneter
from yaetos.deploy import terminate
from yaetos.deploy_utils import terminate
from yaetos.airflow_template import get_template
from yaetos.logger import setup_logging
logger = setup_logging('Deploy')
Expand Down
8 changes: 1 addition & 7 deletions yaetos/deploy_emr.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import time
import botocore
from yaetos.deploy import terminate
from yaetos.deploy_utils import terminate
from yaetos.logger import setup_logging
logger = setup_logging('Deploy')


class EMRer():
# def run_direct_k8s(self):

# @staticmethod
# def get_spark_submit_args_k8s(app_file, app_args):

# def launch_spark_submit_k8s(self, cmdline):

@staticmethod
def run_direct(self):
Expand Down
13 changes: 13 additions & 0 deletions yaetos/deploy_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from yaetos.logger import setup_logging
logger = setup_logging('Deploy')


def terminate(error_message=None):
"""
Method to exit the Python script. It will log the given message and then exit().
:param error_message:
"""
if error_message:
logger.error(error_message)
logger.critical('The script is now terminating')
exit()

0 comments on commit 0da9b77

Please sign in to comment.