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
94488a98
Commit
94488a98
authored
Jun 09, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encoding (temp)
parent
db5acab5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
5 deletions
+41
-5
olapy/core/services/xmla_discover_tools.py
olapy/core/services/xmla_discover_tools.py
+26
-4
olapy/core/services/xmla_execute_tools.py
olapy/core/services/xmla_execute_tools.py
+15
-1
No files found.
olapy/core/services/xmla_discover_tools.py
View file @
94488a98
...
...
@@ -1888,6 +1888,15 @@ class XmlaDiscoverTools():
for
table_name
,
df
in
self
.
executer
.
tables_loaded
.
items
():
if
table_name
==
self
.
executer
.
facts
:
continue
# french caracteres
# TODO encode dataframe
if
type
(
df
.
iloc
[
0
][
0
])
==
unicode
:
column_attribut
=
df
.
iloc
[
0
][
0
].
encode
(
'utf-8'
)
else
:
column_attribut
=
df
.
iloc
[
0
][
0
]
rows
+=
"""
<row>
<CATALOG_NAME>{0}</CATALOG_NAME>
...
...
@@ -1910,8 +1919,11 @@ class XmlaDiscoverTools():
<HIERARCHY_ORIGIN>1</HIERARCHY_ORIGIN>
<INSTANCE_SELECTION>0</INSTANCE_SELECTION>
</row>
"""
.
format
(
self
.
selected_catalogue
,
table_name
,
df
.
columns
[
0
],
df
.
iloc
[
0
][
0
])
"""
.
format
(
self
.
selected_catalogue
,
table_name
,
df
.
columns
[
0
],
column_attribut
)
rows
+=
"""
<row>
...
...
@@ -1953,6 +1965,14 @@ class XmlaDiscoverTools():
for
table_name
,
df
in
self
.
executer
.
tables_loaded
.
items
():
if
table_name
==
self
.
executer
.
facts
:
continue
# french caracteres
# TODO encode dataframe
if
type
(
df
.
iloc
[
0
][
0
])
==
unicode
:
column_attribut
=
df
.
iloc
[
0
][
0
].
encode
(
'utf-8'
)
else
:
column_attribut
=
df
.
iloc
[
0
][
0
]
rows
+=
"""
<row>
<CATALOG_NAME>{0}</CATALOG_NAME>
...
...
@@ -1975,8 +1995,10 @@ class XmlaDiscoverTools():
<HIERARCHY_ORIGIN>1</HIERARCHY_ORIGIN>
<INSTANCE_SELECTION>0</INSTANCE_SELECTION>
</row>
"""
.
format
(
self
.
selected_catalogue
,
table_name
,
df
.
columns
[
0
],
df
.
iloc
[
0
][
0
])
"""
.
format
(
self
.
selected_catalogue
,
table_name
,
df
.
columns
[
0
],
column_attribut
)
rows
+=
"""
<row>
...
...
olapy/core/services/xmla_execute_tools.py
View file @
94488a98
...
...
@@ -149,6 +149,12 @@ class XmlaExecuteTools():
for
tupl
in
tupls
:
tuple_without_minus_1
=
self
.
get_tuple_without_nan
(
tupl
)
# french caracteres
# TODO encode dataframe
if
type
(
tuple_without_minus_1
[
-
1
])
==
unicode
:
tuple_without_minus_1
=
[
x
.
encode
(
'utf-8'
)
for
x
in
tuple_without_minus_1
]
axis0
+=
"""
<Member Hierarchy="[{0}].[{0}]">
<UName>[{0}].[{0}].[{1}].{2}</UName>
...
...
@@ -550,6 +556,14 @@ class XmlaExecuteTools():
set
(
table_name
for
table_name
in
mdx_execution_result
[
'columns_desc'
]
[
'all'
])):
# TODO encode dataframe
# french caracteres
if
type
(
self
.
executer
.
tables_loaded
[
dim_diff
].
iloc
[
0
][
0
])
==
unicode
:
column_attribut
=
self
.
executer
.
tables_loaded
[
dim_diff
].
iloc
[
0
][
0
].
encode
(
'utf-8'
)
else
:
column_attribut
=
self
.
executer
.
tables_loaded
[
dim_diff
].
iloc
[
0
][
0
]
tuple
+=
"""
<Member Hierarchy="[{0}].[{0}]">
<UName>[{0}].[{0}].[{1}].[{2}]</UName>
...
...
@@ -560,7 +574,7 @@ class XmlaExecuteTools():
</Member>
"""
.
format
(
dim_diff
,
self
.
executer
.
tables_loaded
[
dim_diff
].
columns
[
0
],
self
.
executer
.
tables_loaded
[
dim_diff
].
iloc
[
0
][
0
]
)
column_attribut
)
# if we have zero on one only measures used
if
len
(
self
.
executer
.
selected_measures
)
<=
1
:
...
...
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