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
e860fadc
Commit
e860fadc
authored
Jun 08, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimization 2 (use iter instead fetchall())
parent
732b4d9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
olapy/core/mdx/executor/execute_db.py
olapy/core/mdx/executor/execute_db.py
+4
-3
No files found.
olapy/core/mdx/executor/execute_db.py
View file @
e860fadc
...
...
@@ -28,9 +28,10 @@ def _load_tables_db(executer_instance):
.
execution_options
(
stream_results
=
True
)
.
execute
(
'SELECT * FROM "{0}"'
.
format
(
table_name
)))
# Fetch all the results of the query
fetchall
=
results
.
fetchall
()
# fetchall = results.fetchone()
value
=
pd
.
DataFrame
(
fetchall
,
columns
=
results
.
keys
())
# fetchall = results.fetchall()
# # fetchall = results.fetchone()
# value = pd.DataFrame(fetchall,columns=results.keys())
value
=
pd
.
DataFrame
(
iter
(
results
),
columns
=
results
.
keys
())
# Pass results as an iterator
tables
[
table_name
]
=
value
[[
col
for
col
in
value
.
columns
if
col
.
lower
()[
-
3
:]
!=
'_id'
...
...
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