Skip to content

Commit

Permalink
fixed issue with nested focus modular pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: rashidakanchwala <[email protected]>
  • Loading branch information
rashidakanchwala committed Nov 19, 2024
1 parent f27384a commit 9d4b8da
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Please follow the established format:
- Refactor `DatasetStatsHook` to avoid showing error when dataset doesn't have file size info (#2174)
- Fix 404 error when accessing the experiment tracking page on the demo site (#2179)
- Add check for port availability before starting Kedro Viz to prevent unintended browser redirects when the port is already in use (#2176)
- Include Kedro Viz version in telemetry.. (#2194)


# Release 10.0.0
Expand Down
2 changes: 1 addition & 1 deletion demo-project/.telemetry
Original file line number Diff line number Diff line change
@@ -1 +1 @@
consent: false
consent: true
3 changes: 3 additions & 0 deletions demo-project/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ kedro_init_version = "0.19.0"
addopts = """
--cov-report term-missing \
--cov src/demo_project -ra"""

[tool.kedro_telemetry]
project_id = "5dc4813ee2ef4c2a8a8f8022e6a13cff"
4 changes: 3 additions & 1 deletion package/kedro_viz/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ async def index():
env = Environment(loader=FileSystemLoader(_HTML_DIR))
if should_add_telemetry:
telemetry_content = env.get_template("telemetry.html").render(
heap_app_id=heap_app_id, heap_user_identity=heap_user_identity
heap_app_id=heap_app_id,
heap_user_identity=heap_user_identity,
kedro_viz_version=__version__,
)
injected_head_content.append(telemetry_content)

Expand Down
1 change: 1 addition & 0 deletions public/telemetry.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
heap.load("{{ heap_app_id }}");
heap.identify("{{ heap_user_identity }}");
heap.addEventProperties("{{ kedro_viz_version }}");
</script>
</head>
13 changes: 11 additions & 2 deletions src/selectors/disabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,24 @@ export const getnodesDisabledViaModularPipeline = createSelector(
...modularPipelinesTree[focusedModularPipeline.id].outputs,
];

const isChildModularPipeline = (modularPipelineId, focusedPipelineId) =>
modularPipelineId.startsWith(`${focusedPipelineId}.`);

const isChildNode = (nodeId) =>
nodeModularPipelines[nodeId].includes(focusedModularPipeline.id);

if (nodeType[id] === 'modularPipeline') {
return (
id !== focusedModularPipeline.id &&
!id.startsWith(`${focusedModularPipeline.id}.`)
!isChildModularPipeline(id, focusedModularPipeline.id)
);
}

isDisabledViaFocusedModularPipeline =
!nodeModularPipelines[id].includes(focusedModularPipeline.id) &&
!isChildNode(id) &&
!nodeModularPipelines[id].some((pipelineId) =>
isChildModularPipeline(pipelineId, focusedModularPipeline.id)
) &&
!inputOutputNodeIDs.includes(id);
}

Expand Down

0 comments on commit 9d4b8da

Please sign in to comment.