Number of parameters does not match
Self Checks
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
0.5.8
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
The IndexProcessorFactory constructor has only one input parameter:
But extra parameters were passed in IndexingRunner:
✔️ Expected Behavior
Remove extra parameters
❌ Actual Behavior
Number of parameters does not match
Hey @wangrg, great to see you around again! Hope you're doing well.
Thank you for bringing this to our attention. The IndexProcessorFactory constructor in Dify version 0.5.8 is designed to accept only one parameter, which is the index type. This is evident from the code snippet:
class IndexProcessorFactory:
"""IndexProcessorInit.
"""
def __init__(self, index_type: str):
self._index_type = index_type
The IndexProcessorFactory is used to abstract the creation logic of different types of index processors. The single parameter passed to the constructor determines the specific type of index processor to be created, and no extra parameters are directly passed to the constructor itself.
The additional operations and method calls seen in the IndexingRunner class, such as .init_index_processor(), .extract(), .transform(), and .load(), are not part of the constructor call but are subsequent operations on the index processor object returned by the factory. These methods may accept multiple parameters based on their definitions in the respective classes, but these are unrelated to the constructor of the IndexProcessorFactory.
In summary, the IndexProcessorFactory constructor is designed to accept a single parameter to specify the type of index processor to be created. The perceived extra parameters are actually arguments to methods called on the index processor object, not the factory constructor itself.
If you have further questions or need additional clarification, please let me know.
Sources
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
pls check your code is the latest, thanks @wangrg
it looks fine at the latest main branch
Hi, @wangrg,
I'm helping the team manage our backlog and am marking this issue as stale. The issue was raised regarding a discrepancy in the number of parameters between the IndexProcessorFactory constructor and the IndexingRunner. It was clarified that the IndexProcessorFactory constructor is designed to accept a single parameter to specify the type of index processor to be created, and the perceived extra parameters are actually arguments to methods called on the index processor object, not the factory constructor itself. Additionally, it was confirmed that the latest code in the main branch looks fine.
Could you please confirm if this issue is still relevant to the latest version of the repository? If it is, please let the team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding and cooperation.
I