File tree 3 files changed +27
-2
lines changed
3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 164
164
165
165
- Bug in :func:`read_stata` where value labels could not be read when using an iterator (:issue:`16923`)
166
166
167
+ - Bug in :func:`read_html` importcheck fails when run concurrently (:issue:`16928`)
168
+
167
169
Plotting
168
170
^^^^^^^^
169
171
- Bug in plotting methods using ``secondary_y`` and ``fontsize`` not setting secondary axis font size (:issue:`12565`)
Original file line number Diff line number Diff line change @@ -37,8 +37,6 @@ def _importers():
37
37
if _IMPORTS :
38
38
return
39
39
40
- _IMPORTS = True
41
-
42
40
global _HAS_BS4 , _HAS_LXML , _HAS_HTML5LIB
43
41
44
42
try :
@@ -59,6 +57,8 @@ def _importers():
59
57
except ImportError :
60
58
pass
61
59
60
+ _IMPORTS = True
61
+
62
62
63
63
#############
64
64
# READ HTML #
Original file line number Diff line number Diff line change @@ -931,3 +931,26 @@ def test_same_ordering():
931
931
dfs_lxml = read_html (filename , index_col = 0 , flavor = ['lxml' ])
932
932
dfs_bs4 = read_html (filename , index_col = 0 , flavor = ['bs4' ])
933
933
assert_framelist_equal (dfs_lxml , dfs_bs4 )
934
+
935
+
936
+ class ErrorThread (threading .Thread ):
937
+ def run (self ):
938
+ try :
939
+ super (ErrorThread , self ).run ()
940
+ except Exception as e :
941
+ self .err = e
942
+ else :
943
+ self .err = None
944
+
945
+
946
+ @pytest .mark .slow
947
+ def test_importcheck_thread_safety ():
948
+ reload (pandas .io .html )
949
+ filename = os .path .join (DATA_PATH , 'valid_markup.html' )
950
+ helper_thread1 = ErrorThread (target = read_html , args = (filename ,))
951
+ helper_thread2 = ErrorThread (target = read_html , args = (filename ,))
952
+ helper_thread1 .start ()
953
+ helper_thread2 .start ()
954
+ while (helper_thread1 .is_alive () or helper_thread2 .is_alive ()):
955
+ pass
956
+ assert None is helper_thread1 .err is helper_thread2 .err
You can’t perform that action at this time.
0 commit comments