Skip to content

feat: return common type in SuperComponent type compatibility check #9275

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

Merged

Conversation

mdrazak2001
Copy link
Contributor

Related Issues

Proposed Changes:

  • modified _types_are_compatible to return Tuple[bool, Optional[T]]
  • updated super_component.py to use the common type returned by _types_are_compatible

How did you test it?

  • added unit tests

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@mdrazak2001 mdrazak2001 requested review from a team as code owners April 21, 2025 17:35
@mdrazak2001 mdrazak2001 requested review from dfokina and mpangrazzi and removed request for a team April 21, 2025 17:35
@coveralls
Copy link
Collaborator

coveralls commented Apr 24, 2025

Pull Request Test Coverage Report for Build 15186561857

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 20 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.05%) to 90.358%

Files with Coverage Reduction New Missed Lines %
core/super_component/super_component.py 4 95.83%
core/super_component/utils.py 16 86.61%
Totals Coverage Status
Change from base Build 15182795258: -0.05%
Covered Lines: 11142
Relevant Lines: 12331

💛 - Coveralls

Copy link
Contributor

@mpangrazzi mpangrazzi left a comment

Choose a reason for hiding this comment

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

I've added a few suggestions to fix current type issues.

You also need to change the return type of _check_non_union_compatibility and _is_compatible to Tuple[bool, Optional[T]]:.

Type checking should pass then!

@github-actions github-actions bot added the type:documentation Improvements on the docs label May 15, 2025
@mdrazak2001 mdrazak2001 requested a review from mpangrazzi May 15, 2025 14:19
@mpangrazzi
Copy link
Contributor

LGTM, but would kindly ask to @sjrl for a second look

@mpangrazzi mpangrazzi requested a review from sjrl May 16, 2025 07:59
@sjrl
Copy link
Contributor

sjrl commented May 20, 2025

@mdrazak2001 this is looking good! Just one comment about updating more of the unit tests, but otherwise should be good to go.

@mdrazak2001 mdrazak2001 requested a review from sjrl May 22, 2025 05:01
Copy link
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this!

Copy link
Contributor

@mpangrazzi mpangrazzi left a comment

Choose a reason for hiding this comment

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

LGTM! I've left a minor nit, when done we should be able to merge! Thanks for your work!

@mdrazak2001 mdrazak2001 requested a review from mpangrazzi May 22, 2025 12:18
@mpangrazzi mpangrazzi enabled auto-merge (squash) May 22, 2025 12:28
@mpangrazzi mpangrazzi merged commit 4a5e4d3 into deepset-ai:main May 22, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In SuperComponent utils update _is_compatible(type1, type2) to return the common type
4 participants