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
40f1ab97
Commit
40f1ab97
authored
Jun 08, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve code
parent
19490d30
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
olapy/core/mdx/executor/execute_db.py
olapy/core/mdx/executor/execute_db.py
+3
-8
No files found.
olapy/core/mdx/executor/execute_db.py
View file @
40f1ab97
...
@@ -44,11 +44,8 @@ class StringFolder(object):
...
@@ -44,11 +44,8 @@ class StringFolder(object):
# Look up the unicode value in the map and return
# Look up the unicode value in the map and return
# the object from the map. If there is no matching entry,
# the object from the map. If there is no matching entry,
# store this unicode object in the map and return it.
# store this unicode object in the map and return it.
t
=
self
.
unicode_map
.
get
(
s
,
None
)
return
self
.
unicode_map
.
setdefault
(
s
,
s
)
if
t
is
None
:
# Put s in the map
t
=
self
.
unicode_map
[
s
]
=
s
return
t
def
string_folding_wrapper
(
results
):
def
string_folding_wrapper
(
results
):
"""
"""
...
@@ -82,9 +79,7 @@ def _load_tables_db(executer_instance):
...
@@ -82,9 +79,7 @@ def _load_tables_db(executer_instance):
# 'SELECT * FROM "{0}"'.format(table_name), db.engine)
# 'SELECT * FROM "{0}"'.format(table_name), db.engine)
# results = db.engine.execute('SELECT * FROM "{0}"'.format(table_name))
# results = db.engine.execute('SELECT * FROM "{0}"'.format(table_name))
results
=
(
db
.
engine
results
=
db
.
engine
.
execution_options
(
stream_results
=
True
).
execute
(
'SELECT * FROM "{0}"'
.
format
(
table_name
))
.
execution_options
(
stream_results
=
True
)
.
execute
(
'SELECT * FROM "{0}"'
.
format
(
table_name
)))
# Fetch all the results of the query
# Fetch all the results of the query
# value = pd.DataFrame(iter(results),columns=results.keys()) # Pass results as an iterator
# value = pd.DataFrame(iter(results),columns=results.keys()) # Pass results as an iterator
value
=
pd
.
DataFrame
(
string_folding_wrapper
(
results
),
columns
=
results
.
keys
())
value
=
pd
.
DataFrame
(
string_folding_wrapper
(
results
),
columns
=
results
.
keys
())
...
...
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