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
a351457d
Commit
a351457d
authored
May 03, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid consecutive if-statements
parent
1e4a8b9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
olapy/core/mdx/parser/parse.py
olapy/core/mdx/parser/parse.py
+14
-14
No files found.
olapy/core/mdx/parser/parse.py
View file @
a351457d
...
...
@@ -52,28 +52,28 @@ class MdxParser:
types
=
[
SelectStatement
]))
ast
=
model
.
parse
(
query
,
rule_name
=
MdxParser
.
START
,
ignorecase
=
True
)
if
axis
==
"column"
:
if
ast
.
select_statement
.
axis_specification_columns
is
not
None
:
if
u''
in
ast
.
select_statement
.
axis_specification_columns
:
ast
.
select_statement
.
axis_specification_columns
.
remove
(
u''
)
if
ast
.
select_statement
.
axis_specification_columns
is
not
None
and
\
u''
in
ast
.
select_statement
.
axis_specification_columns
:
ast
.
select_statement
.
axis_specification_columns
.
remove
(
u''
)
return
ast
.
select_statement
.
axis_specification_columns
elif
axis
==
"row"
:
if
ast
.
select_statement
.
axis_specification_rows
is
not
None
:
if
u''
in
ast
.
select_statement
.
axis_specification_rows
:
ast
.
select_statement
.
axis_specification_rows
.
remove
(
u''
)
if
ast
.
select_statement
.
axis_specification_rows
is
not
None
and
\
u''
in
ast
.
select_statement
.
axis_specification_rows
:
ast
.
select_statement
.
axis_specification_rows
.
remove
(
u''
)
return
ast
.
select_statement
.
axis_specification_rows
elif
axis
==
"cube"
:
if
ast
.
select_statement
.
cube_specification
is
not
None
:
if
u''
in
ast
.
select_statement
.
cube_specification
:
ast
.
select_statement
.
cube_specification
.
remove
(
u''
)
if
ast
.
select_statement
.
cube_specification
is
not
None
and
\
u''
in
ast
.
select_statement
.
cube_specification
:
ast
.
select_statement
.
cube_specification
.
remove
(
u''
)
return
ast
.
select_statement
.
cube_specification
[
1
]
if
\
isinstance
(
ast
.
select_statement
.
cube_specification
,
list
)
\
else
ast
.
select_statement
.
cube_specification
elif
axis
==
"condition"
:
if
ast
.
select_statement
.
condition_specification
is
not
None
:
if
type
(
ast
.
select_statement
.
condition_specification
)
not
in
(
unicode
,
str
):
if
u''
in
ast
.
select_statement
.
condition_specification
:
ast
.
select_statement
.
condition_specification
.
remove
(
u''
)
if
ast
.
select_statement
.
condition_specification
is
not
None
and
\
type
(
ast
.
select_statement
.
condition_specification
)
not
in
(
unicode
,
str
)
and
\
u''
in
ast
.
select_statement
.
condition_specification
:
ast
.
select_statement
.
condition_specification
.
remove
(
u''
)
return
ast
.
select_statement
.
condition_specification
elif
axis
==
"all"
:
...
...
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