haystack icon indicating copy to clipboard operation
haystack copied to clipboard

Refactor PipelineBase._validate_input() method

Open carlosrinc opened this issue 6 months ago • 10 comments

I've refactored the PipelineBase._validate_input() method to improve clarity and maintainability. This involved breaking down the method into smaller helper functions and enhancing error messages for better specificity.

I also added comprehensive unit tests to cover various input validation scenarios, ensuring the refactored method behaves as expected.

Related Issues

  • fixes #issue-number

Proposed Changes:

How did you test it?

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

carlosrinc avatar Jun 16 '25 20:06 carlosrinc

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

:white_check_mark: carlosrinc
:white_check_mark: mpangrazzi
:x: google-labs-jules[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jun 16 '25 20:06 CLAassistant

Hi team, just to clarify the status of the CLA: google-labs-jules[bot] was a support tool that generated the commits under my supervision. I, carlosrinc, am the contributor and have already signed the CLA. Please let me know if you need anything else.

carlosrinc avatar Jun 17 '25 15:06 carlosrinc

Hi @mpangrazzi,

Thanks for the feedback! I've updated the PR:

The validate_input method in PipelineBase is now public again, restoring the original method signature to prevent breaking changes. The detailed, component-specific validation logic remains in the private _validate_component_input helper method. I've also rechecked the tests to ensure they call the public validate_input method. Let me know if there's anything else.

carlosrinc avatar Jun 18 '25 14:06 carlosrinc

@carlosrinc Nice! But it seems you still need to:

mpangrazzi avatar Jun 19 '25 12:06 mpangrazzi

Hi @mpangrazzi, thanks for the feedback!. Make tests pass (ATM you have a code format issue) ---> Done.

Could you please add the ignore-for-release-notes tag to this PR to fix the CI check?. I can't find the option to do it myself. This is because it's an internal refactoring that doesn't change the user-visible behavior.

carlosrinc avatar Jun 19 '25 15:06 carlosrinc

Make tests pass (ATM you have a code format issue) ---> Done.

There's still a format issue, you probabily need to run hatch run fmt (as stated in our contribution guide).

Could you please add the ignore-for-release-notes tag to this PR to fix the CI check?. I can't find the option to do it myself. This is because it's an internal refactoring that doesn't change the user-visible behavior.

I think it could be nice to add a release note for a refactoring. An example is here (you can find other ones under releasenotes folder).

mpangrazzi avatar Jun 19 '25 15:06 mpangrazzi

Hi @mpangrazzi, thanks for the feedback!. Its done.

carlosrinc avatar Jun 20 '25 13:06 carlosrinc

Hi @mpangrazzi, any additional feedbak?. Thanks!.

carlosrinc avatar Jun 26 '25 14:06 carlosrinc

@carlosrinc it seems you still have that format issue.

mpangrazzi avatar Jun 27 '25 14:06 mpangrazzi

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Nov 20 '25 02:11 github-actions[bot]