Skip to content

Commit 182da6f

Browse files
jiyongjungtfx-copybara
jiyongjung
authored andcommitted
Skips a flakky airflow test on macos.
Recent versions of Tensorflow and Airflow makes test fails with segmentation faults. Airflow doesn't support macos as an execution environment.[1] [1] apache/airflow#11965 (comment) PiperOrigin-RevId: 364952307
1 parent 4d418c7 commit 182da6f

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

tfx/examples/chicago_taxi_pipeline/taxi_pipeline_simple_airflow_e2e_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
"""End to end test for tfx.orchestration.airflow."""
1515

1616
import os
17+
import platform
1718
import subprocess
1819
import time
1920
from typing import Sequence, Set, Text
21+
import unittest
2022

2123
import absl
2224
import tensorflow as tf
@@ -54,6 +56,11 @@ def __exit__(self, exception_type, exception_value, traceback): # pylint: disab
5456
_PENDING_TASK_STATES = set(['queued', 'scheduled', 'running', 'none'])
5557

5658

59+
@unittest.skipIf(
60+
platform.system() == 'Darwin',
61+
'Airflow is not compatible with TF in some environments on macos and '
62+
'Airflow Executor is not supported on macos. See b/178137745.'
63+
)
5764
class AirflowEndToEndTest(test_case_utils.TfxTest):
5865
"""An end to end test using fully orchestrated Airflow."""
5966

tfx/tools/cli/handler/base_handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ def _subprocess_call(self,
191191
def _format_table(self, header: Collection[Any],
192192
data: Collection[Collection[Any]]):
193193

194-
def _format_as_strings(items):
195-
return [f' {item} ' for item in items]
194+
def _force_strings(items):
195+
return [str(item) for item in items]
196196

197-
header = _format_as_strings(header)
198-
data = [_format_as_strings(row) for row in data]
197+
header = _force_strings(header)
198+
data = [_force_strings(row) for row in data]
199199

200200
max_widths = [len(s) for s in header]
201201
for row in data:

tfx/tools/cli/handler/base_handler_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@ def testFormatTable(self):
207207
handler = FakeHandler(flags_dict)
208208
self.assertEqual(
209209
textwrap.dedent("""\
210-
+=====+=====+=======+
211-
| abc | d | False |
212-
+=====+=====+=======+
213-
| 1 | 234 | None |
214-
+-----+-----+-------+
215-
| xxx | | [] |
216-
+=====+=====+=======+
210+
+===+===+=====+
211+
|abc|d |False|
212+
+===+===+=====+
213+
|1 |234|None |
214+
+---+---+-----+
215+
|xxx| |[] |
216+
+===+===+=====+
217217
"""),
218218
handler._format_table(('abc', 'd', False),
219219
[[1, '234', None], ['xxx', '', []]]))

0 commit comments

Comments
 (0)