Commit 020b1ea3 authored by Julien Muchembled's avatar Julien Muchembled

Make some dependencies optional: pandas, wendelin

testRestrictedPythonSecurity imports *_black_list variables.
parent db633b6f
...@@ -463,22 +463,21 @@ else: ...@@ -463,22 +463,21 @@ else:
allow_class(pd.DataFrame) allow_class(pd.DataFrame)
# Note: These black_list methods are for pandas 0.19.2 # Note: These black_list methods are for pandas 0.19.2
series_black_list = ('to_csv', 'to_json', 'to_pickle', 'to_hdf',
'to_sql', 'to_msgpack')
ContainerAssertions[pd.Series] = _check_access_wrapper( ContainerAssertions[pd.Series] = _check_access_wrapper(
pd.Series, dict.fromkeys(( pd.Series, dict.fromkeys(series_black_list, restrictedMethod))
'to_csv', 'to_json', 'to_pickle', 'to_hdf', 'to_sql', 'to_msgpack',
), restrictedMethod))
ModuleSecurityInfo('pandas').declarePrivate( pandas_black_list = ('read_csv', 'read_json', 'read_pickle', 'read_hdf',
'read_csv', 'read_json', 'read_pickle', 'read_hdf', 'read_fwf', 'read_fwf', 'read_excel', 'read_html', 'read_msgpack',
'read_excel', 'read_html', 'read_msgpack', 'read_gbq', 'read_sas', 'read_stata')
'read_gbq', 'read_sas', 'read_stata', ModuleSecurityInfo('pandas').declarePrivate(*pandas_black_list)
)
dataframe_black_list = ('to_csv', 'to_json', 'to_pickle', 'to_hdf',
'to_excel', 'to_html', 'to_sql', 'to_msgpack',
'to_latex', 'to_gbq', 'to_stata')
ContainerAssertions[pd.DataFrame] = _check_access_wrapper( ContainerAssertions[pd.DataFrame] = _check_access_wrapper(
pd.DataFrame, dict.fromkeys(( pd.DataFrame, dict.fromkeys(dataframe_black_list, restrictedMethod))
'to_csv', 'to_json', 'to_pickle', 'to_hdf', 'to_excel', 'to_html',
'to_sql', 'to_msgpack', 'to_latex', 'to_gbq', 'to_stata',
), restrictedMethod))
safetype.update(dict.fromkeys(( safetype.update(dict.fromkeys((
pd.DataFrame, pd.DataFrame,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment