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

Closed
5 tasks done
CN-P5 opened this issue Jan 11, 2025 · 1 comment · Fixed by #12638
Closed
5 tasks done

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

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

Comments

@CN-P5
Copy link
Contributor

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 added a commit to CN-P5/dify that referenced this issue Jan 11, 2025
crazywoola pushed a commit that referenced this issue Jan 13, 2025
Scorpion1221 added a commit to yybht155/dify that referenced this issue Jan 14, 2025
* commit '6e0fb055d18969eb923e719ad92ecac3a5c5d534': (42 commits)
  chore: bump version to 0.15.1 (langgenius#12690)
  feat: add table of contents to Knowledge API doc (langgenius#12688)
  [fix] support feature restore (langgenius#12563)
  api tool support multiple env url (langgenius#12249)
  Add new integration with Opik Tracking tool (langgenius#11501)
  fix: add type hints for App model and improve error handling in audio services (langgenius#12677)
  fix: Update variable handling in VariableAssignerNode and clean up app_dsl_service (langgenius#12672)
  Revert "Feat/new saas billing" (langgenius#12673)
  fix(workflow): fix answer node stream processing in conditional branches (langgenius#12510)
  fix: ruff with statements (langgenius#12578)
  fix: ruff check for True if ... else (langgenius#12576)
  chore: Adjust translations to align with Taiwanese Mandarin conventions (langgenius#12633)
  Fix pandas indexing method for knowledge base imports (langgenius#12637) (langgenius#12638)
  Feat/new saas billing (langgenius#12591)
  improve the readability of the function generate_api_key (langgenius#12552)
  chore: translate i18n files (langgenius#12543)
  Feat/add knowledge include all filter (langgenius#12537)
  fix: Add datasets list access control and fix datasets config display issue (langgenius#12533)
  fix: sum costs return error value on overview page (langgenius#12534)
  feat: show workflow running status (langgenius#12531)
  ...

# Conflicts:
#	api/poetry.lock
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