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

Knowledge Base Document Q&A Format Batch Add Segment Failure #12637

Open
5 tasks done
CN-P5 opened this issue Jan 11, 2025 · 1 comment · May be fixed by #12638
Open
5 tasks done

Knowledge Base Document Q&A Format Batch Add Segment Failure #12637

CN-P5 opened this issue Jan 11, 2025 · 1 comment · May be fixed by #12638
Labels
🐞 bug Something isn't working

Comments

@CN-P5
Copy link

CN-P5 commented Jan 11, 2025

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create Knowledge-Upload file
    image
  2. Batch add Chunk Upload csv file
    image

log of the api container:

/app/api/controllers/console/datasets/datasets_segments.py:371: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  data = {"content": row[0], "answer": row[1]}

✔️ Expected Behavior

No response

❌ Actual Behavior

Run batch failed

@dosubot dosubot bot added the 🐞 bug Something isn't working label Jan 11, 2025
Copy link

dosubot bot commented Jan 11, 2025

@CN-P5 Hello there! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer.

The "Run batch failed" error you're encountering during the batch add process in Dify could be related to the deprecation warning in your logs. The warning indicates that the code is using Series.__getitem__ to access elements by position, which is deprecated. This could potentially lead to issues in future versions of pandas.

To address this, you should modify the code to use ser.iloc[pos] for accessing elements by position. This change will ensure compatibility with future versions of pandas and might resolve the batch process failure if it's related to this issue.

Here's a quick example of how you might adjust the code:

data = {"content": row.iloc[0], "answer": row.iloc[1]}

Make sure to review the rest of the code for similar issues and update them accordingly. This should help prevent any unexpected behavior due to deprecated methods.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@CN-P5 CN-P5 linked a pull request Jan 11, 2025 that will close this issue
5 tasks
CN-P5 added a commit to CN-P5/dify that referenced this issue Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant