Commit 5ed15561 authored by mouadh's avatar mouadh

Merge branch 'msolap.7'

# Conflicts:
#	requirements.txt
parents 1fb79bb3 1a613efe
......@@ -207,7 +207,7 @@ class MdxEngine:
if config_file_parser.config_file_exist(
self.client
) and self.cube in config_file_parser.get_cubes_names(
client_type='web'):
client_type=self.client):
for cubes in config_file_parser.construct_cubes(self.client):
# TODO cubes.source == 'csv'
if cubes.source == 'postgres':
......
......@@ -72,14 +72,14 @@ def _construct_star_schema_config_file(executer_instance, cubes_obj):
df.rename(columns=dimension.columns, inplace=True)
# todo test with this
fusion = fusion.merge(
df, left_on=fact_key, right_on=dimension_and_key.split('.')[1])
# fusion = fusion.merge(
# df, left_on=fact_key, right_on=dimension_and_key.split('.')[1])
# TODO CHOSE BETWEEN THOSES DF
# fusion = fusion.merge(
# df, left_on=fact_key, right_on=dimension_and_key.split('.')[1], how='left',
# # remove suffixe from dimension and keep the same column name for facts
# suffixes=('', '_y'))
fusion = fusion.merge(
df, left_on=fact_key, right_on=dimension_and_key.split('.')[1], how='left',
# remove suffixe from dimension and keep the same column name for facts
suffixes=('', '_y'))
memory_usage("2 - after query, before fetchall /////// _construct_star_schema_config_file")
# TODO CHOSE BETWEEN THOSES DF
......
from __future__ import absolute_import, division, print_function
import os
from collections import OrderedDict
from lxml import etree
......@@ -300,11 +301,11 @@ class ConfigParser:
name=xml_dimension.find('name').text,
# column_new_name = [key.attrib['column_new_name'] for key in xml_dimension.findall('name')],
displayName=xml_dimension.find('displayName').text,
columns={
column_name.text : None if not column_name.attrib else column_name.attrib['column_new_name']
columns=OrderedDict(
(column_name.text , None if not column_name.attrib else column_name.attrib['column_new_name'])
for column_name in xml_dimension.findall(
'columns/name')
})
))
for xml_dimension in tree.xpath(
'/cubes/cube/dimensions/dimension')
]
......
......@@ -5,6 +5,7 @@ from __future__ import absolute_import, division, print_function
import uuid
from lxml import etree
import os
from ..mdx.executor.execute import MdxEngine
from .xmla_discover_xsds import (
......@@ -73,12 +74,8 @@ class XmlaDiscoverTools():
def discover_properties_response(self, request):
def get_props(xsd, PropertyName, PropertyDescription, PropertyType,
PropertyAccessType, IsRequired, Value):
return etree.fromstring("""
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
""" + xsd + """
if PropertyName is not '':
rows = """
<row>
<PropertyName>{0}</PropertyName>
<PropertyDescription>{1}</PropertyDescription>
......@@ -86,11 +83,63 @@ class XmlaDiscoverTools():
<PropertyAccessType>{3}</PropertyAccessType>
<IsRequired>{4}</IsRequired>
<Value>{5}</Value>
</row>
</root>
</row>
""".format(PropertyName, PropertyDescription, PropertyType,
PropertyAccessType, IsRequired, Value)
else:
rows = """
<row>
<PropertyName>ServerName</PropertyName>
<PropertyDescription>ServerName</PropertyDescription>
<PropertyType>string</PropertyType>
<PropertyAccessType>Read</PropertyAccessType>
<IsRequired>false</IsRequired>
<Value>{0}</Value>
</row>
<row>
<PropertyName>ProviderVersion</PropertyName>
<PropertyDescription>ProviderVersion</PropertyDescription>
<PropertyType>string</PropertyType>
<PropertyAccessType>Read</PropertyAccessType>
<IsRequired>false</IsRequired>
<Value>0.0.3 25-Nov-2016 07:20:28 GMT</Value>
</row>
<row>
<PropertyName>MdpropMdxSubqueries</PropertyName>
<PropertyDescription>MdpropMdxSubqueries</PropertyDescription>
<PropertyType>int</PropertyType>
<PropertyAccessType>Read</PropertyAccessType>
<IsRequired>false</IsRequired>
<Value>15</Value>
</row>
<row>
<PropertyName>MdpropMdxDrillFunctions</PropertyName>
<PropertyDescription>MdpropMdxDrillFunctions</PropertyDescription>
<PropertyType>int</PropertyType>
<PropertyAccessType>Read</PropertyAccessType>
<IsRequired>false</IsRequired>
<Value>3</Value>
</row>
<row>
<PropertyName>MdpropMdxNamedSets</PropertyName>
<PropertyDescription>MdpropMdxNamedSets</PropertyDescription>
<PropertyType>int</PropertyType>
<PropertyAccessType>Read</PropertyAccessType>
<IsRequired>false</IsRequired>
<Value>15</Value>
</row>
""".format(os.getenv('USERNAME', 'default'))
return etree.fromstring("""
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
{0}
{1}
</root>
</return>
""".format(PropertyName, PropertyDescription, PropertyType,
PropertyAccessType, IsRequired, Value))
""".format(xsd,rows))
if request.Restrictions.RestrictionList.PropertyName == 'Catalog':
if request.Properties.PropertyList.Catalog is not None:
......@@ -146,15 +195,7 @@ class XmlaDiscoverTools():
'MdpropMdxNamedSets', 'int', 'Read', 'false',
'15')
return etree.fromstring("""
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
""" + discover_preperties_xsd + """
</root>
</return>
""")
return get_props(discover_preperties_xsd, '','', '', '', '','')
def discover_schema_rowsets_response(self, request):
if request.Restrictions.RestrictionList.SchemaName == "MDSCHEMA_HIERARCHIES" and \
......
......@@ -6,24 +6,10 @@ treelib<2
SQLAlchemy
psycopg2
# tools
pympler
psutil
# Test
werkzeug
# Web
#Flask
#SQLAlchemy<1.1
#WTForms<3
# Pin these for now
#Flask-Login==0.3.2
#Flask-Script==2.0.5
#Flask-Session==0.3.0
#Flask-SQLAlchemy==2.1
#Flask-WTF==0.12
#plotly==1.12.9
#XlsxWriter==0.9.3
# Tools
psutil
pympler
......@@ -4,14 +4,16 @@
#
# pip-compile --output-file requirements.txt requirements.in
#
grako==3.99.9
lxml==3.6.0
numpy==1.12.1 # via pandas
pandas==0.20.1
numpy==1.13.0 # via pandas
pandas==0.20.2
psutil==5.2.2
psycopg2==2.7.1
pympler==0.5
python-dateutil==2.6.0 # via pandas
pytz==2017.2 # via pandas, spyne
six==1.10.0 # via python-dateutil
spyne==2.12.14
sqlalchemy==1.1.10
treelib==1.3.5
werkzeug==0.12.1
werkzeug==0.12.2
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