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
b888ffb9
Commit
b888ffb9
authored
May 12, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
f015faab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
20 deletions
+26
-20
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+9
-10
olapy/core/services/xmla.py
olapy/core/services/xmla.py
+1
-1
olapy/web/views.py
olapy/web/views.py
+16
-9
No files found.
olapy/core/mdx/executor/execute.py
View file @
b888ffb9
...
...
@@ -58,8 +58,7 @@ class MdxEngine:
self
.
tables_loaded
=
self
.
load_tables
()
# all measures
self
.
measures
=
self
.
get_measures
()
self
.
load_star_schema_dataframe
=
self
.
get_star_schema_dataframe
(
cube_name
)
self
.
load_star_schema_dataframe
=
self
.
get_star_schema_dataframe
()
self
.
tables_names
=
self
.
_get_tables_name
()
# default measure is the first one
self
.
selected_measures
=
[
self
.
measures
[
0
]]
...
...
@@ -369,7 +368,7 @@ class MdxEngine:
return
fusion
def
get_star_schema_dataframe
(
self
,
c
ube_name
,
c
lient_type
=
'excel'
):
def
get_star_schema_dataframe
(
self
,
client_type
=
'excel'
):
"""
Merge all DataFrames as star schema.
...
...
@@ -381,23 +380,23 @@ class MdxEngine:
config_file_parser
=
ConfigParser
(
self
.
cube_path
)
if
config_file_parser
.
config_file_exist
(
client_type
)
and
cube_nam
e
in
config_file_parser
.
get_cubes_names
():
)
and
self
.
cub
e
in
config_file_parser
.
get_cubes_names
():
for
cubes
in
config_file_parser
.
construct_cubes
(
client_type
):
# TODO cubes.source == 'csv'
if
cubes
.
source
==
'postgres'
:
# TODO one config file (I will try to merge dimensions between them in web part)
if
client_type
==
'web'
:
fusion
=
self
.
_construct_web_star_schema_config_file
(
cube_nam
e
,
cubes
)
self
.
cub
e
,
cubes
)
else
:
fusion
=
self
.
_construct_star_schema_config_file
(
cube_nam
e
,
cubes
)
self
.
cub
e
,
cubes
)
elif
cube_nam
e
in
self
.
csv_files_cubes
:
fusion
=
self
.
_construct_star_schema_csv_files
(
cube_nam
e
)
elif
self
.
cub
e
in
self
.
csv_files_cubes
:
fusion
=
self
.
_construct_star_schema_csv_files
(
self
.
cub
e
)
elif
cube_nam
e
in
self
.
postgres_db_cubes
:
fusion
=
self
.
_construct_star_schema_db
(
cube_nam
e
)
elif
self
.
cub
e
in
self
.
postgres_db_cubes
:
fusion
=
self
.
_construct_star_schema_db
(
self
.
cub
e
)
return
fusion
[[
col
for
col
in
fusion
.
columns
if
col
.
lower
()[
-
3
:]
!=
'_id'
...
...
olapy/core/services/xmla.py
View file @
b888ffb9
...
...
@@ -13,7 +13,7 @@ from spyne.protocol.soap import Soap11
from
spyne.server.wsgi
import
WsgiApplication
from
..mdx.tools.config_file_parser
import
ConfigParser
from
..services.models
import
DiscoverRequest
# , AuthenticationError
from
..services.models
import
DiscoverRequest
from
..services.models
import
ExecuteRequest
,
Session
from
.xmla_discover_tools
import
XmlaDiscoverTools
from
.xmla_execute_tools
import
XmlaExecuteTools
...
...
olapy/web/views.py
View file @
b888ffb9
...
...
@@ -37,7 +37,6 @@ class Nod:
log_users
=
Logs
(
'users'
)
log_mdx
=
Logs
(
'mdx'
)
def
__init__
(
self
,
text
,
id
,
parent
):
self
.
text
=
text
self
.
id
=
id
...
...
@@ -65,8 +64,8 @@ def generate_tree_levels():
for
c
in
df
.
columns
[
1
:]:
for
k
,
v
in
groupby
(
sorted
((
df
.
groupby
(
list
(
df
.
columns
.
values
[
0
:
df
.
columns
.
get_loc
(
c
)
+
1
])).
groups
).
keys
()),
list
(
df
.
columns
.
values
[
0
:
df
.
columns
.
get_loc
(
c
)
+
1
])).
groups
).
keys
()),
key
=
itemgetter
(
*
range
(
0
,
df
.
columns
.
get_loc
(
c
)))):
if
type
(
k
)
not
in
[
list
,
tuple
]:
...
...
@@ -117,10 +116,11 @@ def login():
login_user
(
user
,
form
.
remember_me
.
data
)
# next to hold the the page that the user tries to visite
Nod
.
log
.
write_log
(
'connected as '
+
str
(
current_user
.
username
))
Nod
.
log_users
.
write_log
(
'connected as '
+
str
(
current_user
.
username
))
Nod
.
log_users
.
write_log
(
'connected as '
+
str
(
current_user
.
username
))
return
redirect
(
request
.
args
.
get
(
'next'
)
or
url_for
(
'execute'
,
user
=
current_user
))
request
.
args
.
get
(
'next'
)
or
url_for
(
'execute'
,
user
=
current_user
))
flash
(
'incorrect username or password'
)
return
render_template
(
'login.html'
,
form
=
form
,
user
=
current_user
)
...
...
@@ -251,8 +251,9 @@ def stats():
return
render_template
(
'stats.html'
,
user
=
current_user
,
table_result
=
temp_rslt
.
to_html
(
classes
=
[
'table table-bordered table-hover table-striped display'
]),
table_result
=
temp_rslt
.
to_html
(
classes
=
[
'table table-bordered table-hover table-striped display'
]),
graphe
=
graph
,
ids
=
graph
[
'ids'
])
...
...
@@ -266,12 +267,18 @@ def logs():
@
app
.
route
(
'/query_builder'
,
methods
=
[
'GET'
,
'POST'
])
@
login_required
def
query_builder
():
df
=
Nod
.
ex
.
load_star_schema_dataframe
# df = Nod.ex.load_star_schema_dataframe
# if not df.empty:
executer
=
MdxEngine
(
'mpr'
)
df
=
executer
.
get_star_schema_dataframe
(
client_type
=
'web'
)
if
not
df
.
empty
:
pivot_ui
(
df
,
outfile_path
=
"olapy/web/templates/pivottablejs.html"
,
height
=
"100%"
)
return
render_template
(
'query_builder.html'
,
user
=
current_user
)
...
...
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