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
e52f0142
Commit
e52f0142
authored
Jul 17, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix query parsing
parent
783f7d63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+1
-1
tests/test_parsing_queries.py
tests/test_parsing_queries.py
+8
-8
No files found.
olapy/core/mdx/executor/execute.py
View file @
e52f0142
...
...
@@ -306,7 +306,7 @@ class MdxEngine:
# clean the query (remove All, Members...)
return [[
tup_att.replace('All ', '').replace('[', "").replace("
]
", "")
for tup_att in tup[0].replace('.Members', '').split('.')
for tup_att in tup[0].replace('.Members', '').split('.')
if tup_att
]
for tup in re.compile(regex).findall(
query.encode("
utf
-
8
")[start:stop])
...
...
tests/test_parsing_queries.py
View file @
e52f0142
...
...
@@ -115,32 +115,32 @@ def test_parsing_query2():
def
test_parsing_query3
():
query_parts
=
executer
.
decorticate_query
(
query3
)
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
,
''
],
[
'Measures'
,
'Amount'
]]
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
],
[
'Measures'
,
'Amount'
]]
assert
query_parts
[
'rows'
]
==
[[
'Measures'
,
'Amount'
]]
assert
query_parts
[
'where'
]
==
[]
assert
query_parts
[
'columns'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
,
''
]]
assert
query_parts
[
'columns'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
]]
query_parts
=
executer
.
decorticate_query
(
query3
+
'
\
n
'
+
where
)
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
,
''
],
[
'Measures'
,
'Amount'
],
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
],
[
'Measures'
,
'Amount'
],
[
'Time'
,
'Calendar'
,
'Day'
,
'May 12,2010'
]]
assert
query_parts
[
'rows'
]
==
[[
'Measures'
,
'Amount'
]]
assert
query_parts
[
'where'
]
==
[]
assert
query_parts
[
'columns'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
,
''
]]
assert
query_parts
[
'columns'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
]]
def
test_parsing_query4
():
query_parts
=
executer
.
decorticate_query
(
query4
)
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Economy'
,
'Partnership'
],
[
'Geography'
,
'Geo'
,
'Country'
,
''
]]
assert
query_parts
[
'rows'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
,
''
]]
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Economy'
,
'Partnership'
],
[
'Geography'
,
'Geo'
,
'Country'
]]
assert
query_parts
[
'rows'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
]]
assert
query_parts
[
'where'
]
==
[]
assert
query_parts
[
'columns'
]
==
[[
'Geography'
,
'Economy'
,
'Partnership'
]]
query_parts
=
executer
.
decorticate_query
(
query4
+
'
\
n
'
+
where
)
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Economy'
,
'Partnership'
],
[
'Geography'
,
'Geo'
,
'Country'
,
''
],
assert
query_parts
[
'all'
]
==
[[
'Geography'
,
'Economy'
,
'Partnership'
],
[
'Geography'
,
'Geo'
,
'Country'
],
[
'Time'
,
'Calendar'
,
'Day'
,
'May 12,2010'
]]
assert
query_parts
[
'rows'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
,
''
]]
assert
query_parts
[
'rows'
]
==
[[
'Geography'
,
'Geo'
,
'Country'
]]
assert
query_parts
[
'where'
]
==
[]
assert
query_parts
[
'columns'
]
==
[[
'Geography'
,
'Economy'
,
'Partnership'
]]
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