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
363eb1fa
Commit
363eb1fa
authored
Jun 15, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unused variable
parent
e6180360
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
olapy/core/mdx/executor/execute.py
olapy/core/mdx/executor/execute.py
+0
-1
olapy/core/mdx/executor/execute_config_file.py
olapy/core/mdx/executor/execute_config_file.py
+5
-7
No files found.
olapy/core/mdx/executor/execute.py
View file @
363eb1fa
...
@@ -41,7 +41,6 @@ class MdxEngine:
...
@@ -41,7 +41,6 @@ class MdxEngine:
csv_files_cubes
=
[]
csv_files_cubes
=
[]
postgres_db_cubes
=
[]
postgres_db_cubes
=
[]
# to show just config file's dimensions
# to show just config file's dimensions
dimension_display_name
=
[]
def
__init__
(
self
,
def
__init__
(
self
,
cube_name
,
cube_name
,
...
...
olapy/core/mdx/executor/execute_config_file.py
View file @
363eb1fa
...
@@ -22,14 +22,13 @@ def _load_table_config_file(executer_instance, cube_obj):
...
@@ -22,14 +22,13 @@ def _load_table_config_file(executer_instance, cube_obj):
memory_usage
(
"1 - before executing query //// _load_table_config_file"
)
memory_usage
(
"1 - before executing query //// _load_table_config_file"
)
for
dimension
in
cube_obj
.
dimensions
:
for
dimension
in
cube_obj
.
dimensions
:
# only certain columns
if
dimension
.
columns
.
keys
():
df
=
psql
.
read_sql_query
(
"SELECT * FROM {0}"
.
format
(
dimension
.
name
),
db
.
engine
)[
dimension
.
columns
.
keys
()]
else
:
df
=
psql
.
read_sql_query
(
"SELECT * FROM {0}"
.
format
(
dimension
.
name
),
df
=
psql
.
read_sql_query
(
"SELECT * FROM {0}"
.
format
(
dimension
.
name
),
db
.
engine
)
db
.
engine
)
# only certain columns
if
dimension
.
columns
.
keys
():
df
=
df
[
dimension
.
columns
.
keys
()]
# change table display name
if
dimension
.
displayName
:
if
dimension
.
displayName
:
table_name
=
dimension
.
displayName
table_name
=
dimension
.
displayName
else
:
else
:
...
@@ -42,8 +41,6 @@ def _load_table_config_file(executer_instance, cube_obj):
...
@@ -42,8 +41,6 @@ def _load_table_config_file(executer_instance, cube_obj):
col
for
col
in
df
.
columns
if
col
.
lower
()[
-
2
:]
!=
'id'
col
for
col
in
df
.
columns
if
col
.
lower
()[
-
2
:]
!=
'id'
]]
]]
executer_instance
.
dimension_display_name
.
append
(
table_name
)
memory_usage
(
"2 - after query, before fetchall /////// _load_table_config_file"
)
memory_usage
(
"2 - after query, before fetchall /////// _load_table_config_file"
)
return
tables
return
tables
...
@@ -79,6 +76,7 @@ def _construct_star_schema_config_file(executer_instance, cubes_obj):
...
@@ -79,6 +76,7 @@ def _construct_star_schema_config_file(executer_instance, cubes_obj):
fusion
=
fusion
.
merge
(
fusion
=
fusion
.
merge
(
df
,
left_on
=
fact_key
,
right_on
=
dimension_and_key
.
split
(
'.'
)[
1
])
df
,
left_on
=
fact_key
,
right_on
=
dimension_and_key
.
split
(
'.'
)[
1
])
# TODO CHOSE BETWEEN THOSES DF
# fusion = fusion.merge(
# fusion = fusion.merge(
# df, left_on=fact_key, right_on=dimension_and_key.split('.')[1], how='left',
# 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
# # remove suffixe from dimension and keep the same column name for facts
...
...
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