Commit 94488a98 authored by mouadh's avatar mouadh

encoding (temp)

parent db5acab5
......@@ -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>
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment