Skip to content

Commit b7ad7f6

Browse files
Enable new CI pipeline for standard & distributed tests (#1481)
* debug * Minor - Add autoimport pandas env var to ray init to fix failing pytest tests * Marking distributed tests * Register marker in pyproject * Adding global mark * removing unecessary assert for wr.config.distributed * setting environment var in codebuild * Adding environment variable assembly * Testing env var with tox * reverting to comprehenstion of ray runtime env vars Co-authored-by: Abdel Jaidi <[email protected]>
1 parent f0362b7 commit b7ad7f6

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

awswrangler/distributed/_distributed.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ def initialize_ray(
107107
)
108108
os.environ["RAY_ENABLE_MAC_LARGE_OBJECT_STORE"] = "1"
109109

110+
ray_runtime_env_vars = [
111+
"__MODIN_AUTOIMPORT_PANDAS__",
112+
]
113+
110114
ray_init_kwargs = {
111115
"num_cpus": cpu_count or multiprocessing.cpu_count(),
112116
"num_gpus": gpu_count,
@@ -115,6 +119,9 @@ def initialize_ray(
115119
"object_store_memory": object_store_memory,
116120
"_redis_password": redis_password,
117121
"_memory": object_store_memory,
122+
"runtime_env": {
123+
"env_vars": {var: os.environ.get(var) for var in ray_runtime_env_vars if os.environ.get(var)}
124+
},
118125
}
119126
ray.init(**ray_init_kwargs)
120127

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,6 @@ warn_unused_ignores = false
129129
log_cli = false
130130
filterwarnings = "ignore::DeprecationWarning"
131131
addopts = "--log-cli-format \"[%(name)s][%(funcName)s] %(message)s\" --verbose --capture=sys"
132+
markers = [
133+
"distributed: tests againsts methods with distributed functionality",
134+
]

tests/test_lakeformation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
import time
44

55
import pandas as pd
6+
import pytest
67

78
import awswrangler as wr
89

910
from ._utils import ensure_data_types, ensure_data_types_csv, get_df, get_df_csv
1011

1112
logging.getLogger("awswrangler").setLevel(logging.DEBUG)
1213

14+
pytestmark = pytest.mark.distributed
15+
1316

1417
def test_lakeformation(path, path2, glue_database, glue_table, glue_table2, use_threads=False):
1518
wr.catalog.delete_table_if_exists(database=glue_database, table=glue_table)

tests/test_s3_select.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
logging.getLogger("awswrangler").setLevel(logging.DEBUG)
1313

14+
pytestmark = pytest.mark.distributed
15+
1416

1517
@pytest.mark.parametrize("use_threads", [True, False, 2])
1618
def test_full_table(path, use_threads):

0 commit comments

Comments
 (0)