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
dc2848f9
Commit
dc2848f9
authored
Apr 19, 2017
by
Mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
parent
81ce493a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+10
-15
No files found.
olapy/core/mdx/executor/execute.py
View file @
dc2848f9
...
...
@@ -17,6 +17,7 @@ from ..tools.connection import MyDB
RUNNING_TOX
=
'RUNTING_TOX'
in
os
.
environ
class
MdxEngine
:
"""
The principal class for executing a query
...
...
@@ -75,14 +76,15 @@ class MdxEngine:
# get csv files folders (cubes)
if
RUNNING_TOX
:
location
=
os
.
path
.
join
(
location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
".."
,
".."
,
".."
,
".."
)),
MdxEngine
.
CUBE_FOLDER
)
else
:
home_directory
=
expanduser
(
"~"
)
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
cls
.
CUBE_FOLDER
)
location
=
os
.
path
.
join
(
home_directory
,
'olapy-data'
,
cls
.
CUBE_FOLDER
)
try
:
MdxEngine
.
csv_files_cubes
=
[
...
...
@@ -325,8 +327,8 @@ class MdxEngine:
for
cubes
in
config_file_parser
.
construct_cubes
():
# TODO cubes.source == 'csv'
if
cubes
.
source
==
'postgres'
:
fusion
=
self
.
_construct_star_schema_config_file
(
cube_name
,
cubes
)
fusion
=
self
.
_construct_star_schema_config_file
(
cube_name
,
cubes
)
elif
cube_name
in
self
.
csv_files_cubes
:
fusion
=
self
.
_construct_star_schema_csv_files
(
cube_name
)
...
...
@@ -648,9 +650,8 @@ class MdxEngine:
:return: updated columns_to_keep
"""
if len(
tuple_as_list
) == 3 and tuple_as_list[-1] in self.tables_loaded[tuple_as_list[0]].columns:
if len(tuple_as_list) == 3 and tuple_as_list[-1] in self.tables_loaded[
tuple_as_list[0]].columns:
# in case of [Geography].[Geography].[Country]
cols = [tuple_as_list[-1]]
else:
...
...
@@ -751,14 +752,8 @@ class MdxEngine:
# TODO groupby in web demo (remove it for more performance)
# TODO margins=True for columns total !!!!!
return {
'result':
# df.drop_duplicates().replace(np.nan, -1).groupby(cols).sum(),
# TODO remove this (FIX V1)
# df.replace(np.nan, -1).groupby(cols).sum()[self.selected_measures],
# TODO chech this FIX
df.groupby(cols).sum()[self.selected_measures],
'columns_desc':
tables_n_columns
'result': df.groupby(cols).sum()[self.selected_measures],
'columns_desc': tables_n_columns
}
else:
...
...
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