Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
olapy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
olapy
Commits
3d6bb11e
Commit
3d6bb11e
authored
May 03, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer static methods over instance methods
parent
3484de7e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
10 deletions
+20
-10
micro_bench/micro_bench.py
micro_bench/micro_bench.py
+2
-1
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+2
-1
olapy/core/mdx/parser/parse.py
olapy/core/mdx/parser/parse.py
+2
-1
olapy/core/services/xmla_discover_tools.py
olapy/core/services/xmla_discover_tools.py
+4
-2
olapy/core/services/xmla_execute_tools.py
olapy/core/services/xmla_execute_tools.py
+6
-3
olapy/web/logger.py
olapy/web/logger.py
+2
-1
olapy/web/stats_utils.py
olapy/web/stats_utils.py
+2
-1
No files found.
micro_bench/micro_bench.py
View file @
3d6bb11e
...
...
@@ -10,7 +10,8 @@ class MicBench:
def
__init__
(
self
,
**
kwargs
):
self
.
__dict__
.
update
(
kwargs
)
def
bench
(
self
,
connection
,
query
,
cube
=
CUBE_NAME
,
number
=
1
):
@
staticmethod
def
bench
(
connection
,
query
,
cube
=
CUBE_NAME
,
number
=
1
):
"""
To be precise, this executes the query statement once, and
then returns the time it takes to execute
...
...
olapy/core/mdx/executor/execute.py
View file @
3d6bb11e
...
...
@@ -575,7 +575,8 @@ class MdxEngine:
return df[cols + self.selected_measures]
def add_missed_column(self, dataframe1, dataframe2):
@staticmethod
def add_missed_column(dataframe1, dataframe2):
"""
solution to fix BUG : https://github.com/pandas-dev/pandas/issues/15525
...
...
olapy/core/mdx/parser/parse.py
View file @
3d6bb11e
...
...
@@ -12,7 +12,8 @@ class MdxParser:
"""
START
=
'MDX_statement'
def
parsing_mdx_query
(
self
,
axis
,
query
):
@
staticmethod
def
parsing_mdx_query
(
axis
,
query
):
'''
Split the query into axis
...
...
olapy/core/services/xmla_discover_tools.py
View file @
3d6bb11e
...
...
@@ -52,7 +52,8 @@ class XmlaDiscoverTools():
if
col
[
-
3
:]
!=
"_id"
]]
def
discover_datasources_response
(
self
):
@
staticmethod
def
discover_datasources_response
():
return
etree
.
fromstring
(
"""
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset"
...
...
@@ -1513,7 +1514,8 @@ class XmlaDiscoverTools():
</return>
"""
)
def
discover_literals_response
(
self
,
request
):
@
staticmethod
def
discover_literals_response
(
request
):
if
request
.
Properties
.
PropertyList
.
Content
==
'SchemaData'
\
and
request
.
Properties
.
PropertyList
.
Format
==
'Tabular'
:
...
...
olapy/core/services/xmla_execute_tools.py
View file @
3d6bb11e
...
...
@@ -12,7 +12,8 @@ class XmlaExecuteTools():
def
__init__
(
self
,
executer
):
self
.
executer
=
executer
def
split_dataframe
(
self
,
mdx_execution_result
):
@
staticmethod
def
split_dataframe
(
mdx_execution_result
):
"""
Split DataFrame into multiple ones by dimension
example:
...
...
@@ -57,7 +58,8 @@ class XmlaExecuteTools():
for
key
,
value
in
mdx_execution_result
[
'columns_desc'
][
'all'
]
.
items
())
def
get_tuple_without_nan
(
self
,
tuple
):
@
staticmethod
def
get_tuple_without_nan
(
tuple
):
"""
remove nan from tuple.
example
...
...
@@ -505,7 +507,8 @@ class XmlaExecuteTools():
return
self
.
generate_one_axis_info
(
mdx_execution_result
)
def
generate_cell_info
(
self
):
@
staticmethod
def
generate_cell_info
():
return
"""
<CellInfo>
<Value name="VALUE"/>
...
...
olapy/web/logger.py
View file @
3d6bb11e
...
...
@@ -15,7 +15,8 @@ class Logs:
self
.
file_name
=
file_name
+
".log"
self
.
root_path
=
self
.
_create_log_file
()
def
_create_log_file
(
self
):
@
staticmethod
def
_create_log_file
():
home_directory
=
expanduser
(
"~"
)
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
'logs'
)
...
...
olapy/web/stats_utils.py
View file @
3d6bb11e
...
...
@@ -13,7 +13,8 @@ class Graphs:
"""
# TODO remove this , ( right know this is just a demo with sales cube )
def
generate_graphes
(
self
,
dataframe
):
@
staticmethod
def
generate_graphes
(
dataframe
):
"""
Generate graphs for a pandas DataFrame, if you want to add graphs, you have to do it in this function
...
...
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