Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
erp5
Commits
020b1ea3
Commit
020b1ea3
authored
Oct 18, 2021
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some dependencies optional: pandas, wendelin
testRestrictedPythonSecurity imports *_black_list variables.
parent
db633b6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
product/ERP5Type/patches/Restricted.py
product/ERP5Type/patches/Restricted.py
+11
-12
No files found.
product/ERP5Type/patches/Restricted.py
View file @
020b1ea3
...
...
@@ -463,22 +463,21 @@ else:
allow_class
(
pd
.
DataFrame
)
# 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
(
pd
.
Series
,
dict
.
fromkeys
((
'to_csv'
,
'to_json'
,
'to_pickle'
,
'to_hdf'
,
'to_sql'
,
'to_msgpack'
,
),
restrictedMethod
))
pd
.
Series
,
dict
.
fromkeys
(
series_black_list
,
restrictedMethod
))
ModuleSecurityInfo
(
'pandas'
).
declarePrivate
(
'read_csv'
,
'read_json'
,
'read_pickle'
,
'read_hdf'
,
'read_fwf'
,
'read_excel'
,
'read_html'
,
'read_msgpack'
,
'read_gbq'
,
'read_sas'
,
'read_stata'
,
)
pandas_black_list
=
(
'read_csv'
,
'read_json'
,
'read_pickle'
,
'read_hdf'
,
'read_fwf'
,
'read_excel'
,
'read_html'
,
'read_msgpack'
,
'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
(
pd
.
DataFrame
,
dict
.
fromkeys
((
'to_csv'
,
'to_json'
,
'to_pickle'
,
'to_hdf'
,
'to_excel'
,
'to_html'
,
'to_sql'
,
'to_msgpack'
,
'to_latex'
,
'to_gbq'
,
'to_stata'
,
),
restrictedMethod
))
pd
.
DataFrame
,
dict
.
fromkeys
(
dataframe_black_list
,
restrictedMethod
))
safetype
.
update
(
dict
.
fromkeys
((
pd
.
DataFrame
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment