File tree 1 file changed +20
-4
lines changed
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import pytest
18
18
import numpy as np
19
- from airflow import utils
20
- from airflow import DAG
21
- from airflow .providers .amazon .aws .operators .sagemaker import SageMakerTrainingOperator
22
- from airflow .providers .amazon .aws .operators .sagemaker_transform import SageMakerTransformOperator
19
+ from configparser import ParsingError
20
+ from sagemaker .utils import retries
21
+
23
22
from six .moves .urllib .parse import urlparse
24
23
25
24
import tests .integ
49
48
from tests .integ .record_set import prepare_record_set_from_local_files
50
49
from tests .integ .timeout import timeout
51
50
51
+ for _ in retries (
52
+ max_retry_count = 10 , # 10*6 = 1min
53
+ exception_message_prefix = "airflow import " ,
54
+ seconds_to_sleep = 6 ,
55
+ ):
56
+ try :
57
+ from airflow import utils
58
+ from airflow import DAG
59
+ from airflow .providers .amazon .aws .operators .sagemaker import SageMakerTrainingOperator
60
+ from airflow .providers .amazon .aws .operators .sagemaker_transform import (
61
+ SageMakerTransformOperator ,
62
+ )
63
+
64
+ break
65
+ except ParsingError :
66
+ pass
67
+
52
68
PYTORCH_MNIST_DIR = os .path .join (DATA_DIR , "pytorch_mnist" )
53
69
PYTORCH_MNIST_SCRIPT = os .path .join (PYTORCH_MNIST_DIR , "mnist.py" )
54
70
AIRFLOW_CONFIG_TIMEOUT_IN_SECONDS = 10
You can’t perform that action at this time.
0 commit comments