|
30 | 30 | import typing |
31 | 31 | import unittest |
32 | 32 | import uuid |
33 | | -from typing import Any |
34 | | -from typing import Dict |
35 | | -from typing import Iterator |
36 | | -from typing import List |
37 | | -from typing import Tuple |
38 | | -from typing import no_type_check |
| 33 | +from contextlib import contextmanager |
| 34 | +from typing import Any, Dict, Iterator, List, Tuple, no_type_check |
39 | 35 |
|
40 | 36 | import hamcrest # pylint: disable=ungrouped-imports |
41 | 37 | import numpy as np |
42 | 38 | import pytest |
43 | 39 | from hamcrest.core.matcher import Matcher |
44 | 40 | from hamcrest.core.string_description import StringDescription |
45 | | -from tenacity import retry |
46 | | -from tenacity import stop_after_attempt |
47 | | -from contextlib import contextmanager |
| 41 | +from tenacity import retry, stop_after_attempt |
| 42 | + |
48 | 43 | import apache_beam as beam |
49 | 44 | from apache_beam.coders import coders |
50 | 45 | from apache_beam.coders.coders import StrUtf8Coder |
|
53 | 48 | from apache_beam.metrics import monitoring_infos |
54 | 49 | from apache_beam.metrics.execution import MetricKey |
55 | 50 | from apache_beam.metrics.metricbase import MetricName |
56 | | -from apache_beam.options.pipeline_options import DebugOptions |
57 | | -from apache_beam.options.pipeline_options import DirectOptions |
58 | | -from apache_beam.options.pipeline_options import PipelineOptions |
59 | | -from apache_beam.options.pipeline_options import StandardOptions |
| 51 | +from apache_beam.options.pipeline_options import ( |
| 52 | + DebugOptions, DirectOptions, PipelineOptions, StandardOptions) |
60 | 53 | from apache_beam.options.value_provider import RuntimeValueProvider |
61 | 54 | from apache_beam.portability import python_urns |
62 | 55 | from apache_beam.runners.portability import fn_api_runner |
63 | 56 | from apache_beam.runners.portability.fn_api_runner import fn_runner |
64 | 57 | from apache_beam.runners.sdf_utils import RestrictionTrackerView |
65 | | -from apache_beam.runners.worker import data_plane |
66 | | -from apache_beam.runners.worker import statesampler |
| 58 | +from apache_beam.runners.worker import data_plane, statesampler |
67 | 59 | from apache_beam.runners.worker.operations import InefficientExecutionWarning |
68 | 60 | from apache_beam.testing.synthetic_pipeline import SyntheticSDFAsSource |
69 | 61 | from apache_beam.testing.test_stream import TestStream |
70 | | -from apache_beam.testing.util import assert_that |
71 | | -from apache_beam.testing.util import equal_to |
72 | | -from apache_beam.testing.util import has_at_least_one |
| 62 | +from apache_beam.testing.util import assert_that, equal_to, has_at_least_one |
73 | 63 | from apache_beam.tools import utils |
74 | | -from apache_beam.transforms import environments |
75 | | -from apache_beam.transforms import trigger |
76 | | -from apache_beam.transforms import userstate |
77 | | -from apache_beam.transforms import window |
| 64 | +from apache_beam.transforms import environments, trigger, userstate, window |
78 | 65 | from apache_beam.transforms.periodicsequence import PeriodicImpulse |
79 | | -from apache_beam.utils import timestamp |
80 | | -from apache_beam.utils import windowed_value |
| 66 | +from apache_beam.utils import timestamp, windowed_value |
81 | 67 |
|
82 | 68 | if statesampler.FAST_SAMPLER: |
83 | 69 | DEFAULT_SAMPLING_PERIOD_MS = statesampler.DEFAULT_SAMPLING_PERIOD_MS |
|
0 commit comments