8000 fixed failed test · gmiretti/server-client-python@2cb93fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 2cb93fe

Browse files
author
bzhang
committed
fixed failed test
1 parent 749551c commit 2cb93fe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

samples/materialize_workbooks.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def main():
2323
help='type of content you want to update materialized views settings on')
2424
parser.add_argument('--file-path', '-fp', required=False, help='path to a list of workbooks')
2525
parser.add_argument('--project-name', '-pn', required=False, help='name of the project')
26-
parser.add_argument('--project-path', '-pp', required =False, help="path of the project")
26+
parser.add_argument('--project-path', '-pp', required=False, help="path of the project")
2727

2828
args = parser.parse_args()
2929

@@ -60,7 +60,11 @@ def main():
6060

6161

6262
def find_project_path(project, all_projects, path):
63-
path = project.name + '/' + path
63+
path = project.name if len(path) == 0 else project.name + '/' + path
64+
# if len(path) == 0:
65+
# path = project.name
66+
# else:
67+
# path = project.name + '/' + path
6468
if project.parent_id is None:
6569
return path
6670
else:
@@ -73,7 +77,7 @@ def get_project_paths(server, projects):
7377

7478
result = dict()
7579
for project in projects:
76-
result[find_project_path(project, all_projects, "")[:-1]] = project
80+
result[find_project_path(project, all_projects, "")] = project
7781
return result
7882

7983

@@ -192,7 +196,7 @@ def update_workbooks_by_paths(all_projects, enable_materialized_views, server, w
192196
print "Updated materialized views settings for workbook:", workbooks[0].name
193197
else:
194198
for workbook in workbooks:
195-
path = find_project_path(all_projects[workbook.project_id], all_projects, "")[:-1]
199+
path = find_project_path(all_projects[workbook.project_id], all_projects, "")
196200
if path in workbook_paths:
197201
workbook.materialized_views_enabled = enable_materialized_views
198202
server.workbooks.update(workbook)

0 commit comments

Comments
 (0)
0