File tree Expand file tree Collapse file tree
sdks/python/apache_beam/transforms Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import logging
2222import os
2323import tempfile
24- import typing
2524import unittest
2625from typing import TypeVar
2726
@@ -330,7 +329,9 @@ def test_multiple_types_for_field(self):
330329 beam .Row (a = 'foo' )]).infer_output_type (None )
331330 self .assertEqual (
332331 output_type ,
333- row_type .RowTypeConstraint .from_fields ([('a' , typing .Union [int , str ])]))
332+ row_type .RowTypeConstraint .from_fields ([
333+ ('a' , typehints .Union [int , str ])
334+ ]))
334335
335336 def test_single_type_for_field (self ):
336337 output_type = beam .Create ([beam .Row (a = 1 ),
@@ -343,7 +344,8 @@ def test_optional_type_for_field(self):
343344 beam .Row (a = None )]).infer_output_type (None )
344345 self .assertEqual (
345346 output_type ,
346- row_type .RowTypeConstraint .from_fields ([('a' , typing .Optional [int ])]))
347+ row_type .RowTypeConstraint .from_fields ([('a' , typehints .Optional [int ])
348+ ]))
347349
348350 def test_none_type_for_field_raises_error (self ):
349351 with self .assertRaisesRegex (TypeError ,
You can’t perform that action at this time.
0 commit comments