Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: While name in query return all trees

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 10, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 10, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zhanweizhang7 zhanweizhang7 merged commit ec51820 into v2 Dec 10, 2025
3 of 5 checks passed
serializer = TreeSerializer(nodes, many=True)
return [d for d in serializer.data if d.get('id') == d.get('workspace_id')] # 这是可序列化的字典

return [d for d in serializer.data if d.get('id') == d.get('workspace_id')] if name is None else serializer.data # 这是可序列化的字典
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two main improvements recommended:

  1. Null Check: Add a null check before the data processing code. This ensures that the function can handle cases where name might be None gracefully.

  •    return [d for d in serializer.data if d.get('id') == d.get('workspace_id')]
    
  •   if not name:
    
  •       return [d for d in serializer.data if d.get('id') == d.get('workspace_id')]
    
  •   ...
    
    
    
  1. Return All Data When Name Is Not Provided: Ensure that when name is provided (i.e., non-NaN), it returns all serializable objects from the serializer without filtering based on the workspace ID.

This changes will make the function more robust and flexible, handling both regular use cases and edge cases like missing or unknown names.

@zhanweizhang7 zhanweizhang7 deleted the pr@v2@fix_while_name branch December 10, 2025 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants