File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
products/data_warehouse/backend/models Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -461,12 +461,23 @@ def update_paths_from_query(
461461 )
462462 except ObjectDoesNotExist :
463463 try :
464- parent_table = (
465- DataWarehouseTable .objects .exclude (deleted = True )
466- .filter (team = team , name = parent )
467- .get ()
468- )
469- except ObjectDoesNotExist :
464+ table = self .get_hogql_database (team ).get_table (parent )
465+ if not isinstance (table , HogQLDataWarehouseTable ):
466+ raise ObjectDoesNotExist ()
467+
468+ if table .table_id :
469+ parent_table = (
470+ DataWarehouseTable .objects .exclude (deleted = True )
471+ .filter (team = team , id = table .table_id )
472+ .get ()
473+ )
474+ else :
475+ parent_table = (
476+ DataWarehouseTable .objects .exclude (deleted = True )
477+ .filter (team = team , name = table .name )
478+ .get ()
479+ )
480+ except (ObjectDoesNotExist , QueryError ):
470481 raise UnknownParentError (parent , query )
471482 else :
472483 parent_id = parent_table .id .hex
You can’t perform that action at this time.
0 commit comments