Parse Switch case/default activities (fixes undercounted inventory & missing lineage edges) - #38
Open
matthewmoorcroft wants to merge 2 commits into
Open
Conversation
…missing lineage edges)
matthewmoorcroft
marked this pull request as ready for review
September 1, 2026 12:16
Rewrite internal package-proxy URLs (pypi-proxy.dev.databricks.com) to pypi.org / files.pythonhosted.org so public CI resolves deps. Same pinned versions and hashes; matches main. Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31
Problem
parse_activityinsrc/flowx/parser/adf_loader.pydescends intoifTrueActivities/ifFalseActivities(IfCondition) andactivities(ForEach/Until), but nevercases[].activitiesordefaultActivitieson a Switch. So a Switch's nested activities never entered theAdfActivityAST, and every AST consumer inherited the blindness:_classify_activities) undercountedactivity_count/coverage_pct._walk_activities) dropped everyExecutePipelineand data edge nested inside a Switch case.Why this is a bug, not a design choice
Verified via git archaeology and the repo's own docs:
git log --all -S 'defaultActivities'/-S '"cases"'return only this commit) — nothing was removed "for a reason."translator/activity_translators/switch.py) has readcases[].activities+defaultActivitiessince the initial release — one half of the tool always understood the shape; the parser half didn't.flowx-discover/SKILL.mddocuments theactivitiescount as "including nested ForEach/If/Switch children", andflowx-convert/SKILL.mddocuments nested gaps inside aSwitchas reported. The code contradicted its own spec."Switch"to the container type-sets but never added case-body parsing — an oversight in that change, not an exclusion. No TODO/FIXME anywhere flags Switch as intentionally unsupported.Fix
switch_cases(case value → activities) andswitch_default_activitiestoAdfActivity, plus aswitch_child_activities()helper for a flat view.parse_activity._classify_activities(inventory) and_walk_activities(lineage).The translate/bundle path is untouched — it reads raw
typeProperties, not these new fields.Verification
activity_count1,804 → 2,159 (+355 across 38 pipelines);ExecutePipelinecalls reachable by the lineage walker 599 → 808 (~209 edges recovered, ~26% of the true control graph — includingorchestrator_main's entire fan-out, previously a near-leaf).convert/SetVariable golden-output failures are present onmainunchanged (verified identical at the base commit) — unrelated to this change.Note on stacked branches
This targets
main. The in-flightfeat/discover-lineage(PR the discover-lineage PR) andfeat/discover-insights(PR the discover-insights PR) both sit on the buggy parser, so their lineage/inventory numbers improve once this lands and they rebase.This pull request and its description were written by Isaac.