File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 11import warnings
2- from distutils .version import StrictVersion
32from re import match
43from time import sleep
54
@@ -217,13 +216,7 @@ def fillna(df, fill_value=""):
217216 """
218217 for col in df .dtypes [df .dtypes == "category" ].index :
219218 if fill_value not in df [col ].cat .categories :
220- df [col ].cat .add_categories ([fill_value ], inplace = True )
221- # Known bug https://github.com/pandas-dev/pandas/issues/25472
222- if StrictVersion (pd .__version__ ) >= StrictVersion ("1.0" ):
223- for col in df .dtypes [
224- df .dtypes .apply (lambda x : x in ["float64" , "int16" ])
225- ].index :
226- df [col ] = df [col ].astype ("float" )
219+ df [col ] = df [col ].cat .add_categories ([fill_value ])
227220 return df .fillna (fill_value )
228221
229222
Original file line number Diff line number Diff line change @@ -45,18 +45,18 @@ def test_oauth_no_key(self, set_oauth_config):
4545 conf .get_creds (user = None )
4646
4747 def test_oauth_first_time (self , mocker , set_oauth_config , creds_json ):
48- mocked = mocker .patch .object (conf .InstalledAppFlow , "run_console " )
48+ mocked = mocker .patch .object (conf .InstalledAppFlow , "run_local_server " )
4949 mocked .return_value = OAuth2Credentials .from_authorized_user_info (creds_json )
5050 conf .get_creds ()
5151 # python 3.5 doesn't have assert_called_once
5252 assert mocked .call_count == 1
5353 assert (conf .get_config_dir () / "creds" / "default" ).exists ()
5454
5555 def test_oauth_first_time_no_save (self , mocker , set_oauth_config ):
56- mocker .patch .object (conf .InstalledAppFlow , "run_console " )
56+ mocker .patch .object (conf .InstalledAppFlow , "run_local_server " )
5757 conf .get_creds (save = False )
5858 # python 3.5 doesn't have assert_called_once
59- assert conf .InstalledAppFlow .run_console .call_count == 1
59+ assert conf .InstalledAppFlow .run_local_server .call_count == 1
6060
6161 def test_oauth_default (self , make_creds ):
6262 assert isinstance (conf .get_creds (), OAuth2Credentials )
You can’t perform that action at this time.
0 commit comments