Skip to content

[SPARK-56387][PYTHON] Refactor ProfileResults to a dict of dict#55251

Open
gaogaotiantian wants to merge 4 commits intoapache:masterfrom
gaogaotiantian:refactor-profile-result
Open

[SPARK-56387][PYTHON] Refactor ProfileResults to a dict of dict#55251
gaogaotiantian wants to merge 4 commits intoapache:masterfrom
gaogaotiantian:refactor-profile-result

Conversation

@gaogaotiantian
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Refactor ProfileResults to a real dict of dict with proper types.

Why are the changes needed?

Currently ProfileResults has a zero value None, which makes the code unnecessarily complicated - we need to take care of None all the time. {} is a perfect zero value for dict already. The values in ProfileResults is a tuple of perf and memory results, even if they don't exist. They are accessed with index and could be None too. We could just not add it to the dict if it does not exist so we don't need to deal with None anymore. We just need to make it a dict.

Does this PR introduce any user-facing change?

No. This should be private API.

How was this patch tested?

test_udf_profiler passed locally.

Was this patch authored or co-authored using generative AI tooling?

No.

@dongjoon-hyun dongjoon-hyun marked this pull request as draft April 8, 2026 15:50
Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please get a JIRA ID and update the PR title before converting to a normal PR from Draft status, @gaogaotiantian .

@gaogaotiantian gaogaotiantian changed the title Refactor ProfileResults to a dict of dict [SPARK-56387][PYTHON] Refactor ProfileResults to a dict of dict Apr 8, 2026
@gaogaotiantian
Copy link
Copy Markdown
Contributor Author

Ah, I was a bit distracted yesterday and forgot to put the JIRA ticket to the PR.

@dongjoon-hyun dongjoon-hyun marked this pull request as ready for review April 8, 2026 18:18
@dongjoon-hyun
Copy link
Copy Markdown
Member

Thank you for revising~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants