Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add component.Info() support lists #2338

Merged
merged 5 commits into from
Jul 25, 2024
Merged

add component.Info() support lists #2338

merged 5 commits into from
Jul 25, 2024

Conversation

EdwardLi-coder
Copy link
Contributor

Description

add component.Info() support lists

Related Issues

[BUG] Component.info() doesn't go inside lists #2234

Checklist

  • Is this code covered by new or existing unit tests or integration tests?
  • Did you run make unit_testing and make integration-testing successfully?
  • Do new classes, functions, methods and parameters all have docstrings?
  • Were existing docstrings updated, if necessary?
  • Was external documentation updated, if necessary?

Additional Notes or Comments

handled_list = []
for item in lst:
if isinstance(item, Leaf):
if len(str(item)) > 50:
Copy link
Collaborator

Choose a reason for hiding this comment

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

since you are already making changes to the file, lets make 50 value a const var.

@@ -418,6 +432,8 @@ def _component_info(obj):
value = str(value)[:50] + "..."
else:
value = str(value)
elif isinstance(value, list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets add test for tuple as well

elif isinstance(value, (tuple, list))

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed.

handled_list.append(str(item)[:50] + "...")
else:
handled_list.append(str(item))
elif isinstance(item, list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can test for tuple as well

@EdwardLi-coder
Copy link
Contributor Author

Hi @kartik4949 ,I have changed it.please review it.Thank you.

@kartik4949 kartik4949 merged commit a399f16 into superduper-io:main Jul 25, 2024
3 checks passed
@EdwardLi-coder EdwardLi-coder deleted the info_support_lists branch July 25, 2024 08:17
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.

3 participants