[BUG] Batch import failed #1000

Closed
opened 2026-02-21 17:29:26 -05:00 by yindo · 3 comments
Owner

Originally created by @luzhouuu on GitHub (Jan 30, 2024).

Originally assigned to: @JohnJyong on GitHub.

Self Checks

Dify version

0.5.2

Cloud or Self Hosted

Cloud

Steps to reproduce

When I try to batch Import annotations by csv file, it failed. I tired in the cloud and self hosted (Source), the log in self-hosted is:

DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
  for ep in entry_points().get(namespace, []):
image

✔️ Expected Behavior

The annotation was uploaded

Actual Behavior

Upload Failed

Originally created by @luzhouuu on GitHub (Jan 30, 2024). Originally assigned to: @JohnJyong on GitHub. ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.5.2 ### Cloud or Self Hosted Cloud ### Steps to reproduce When I try to batch Import annotations by csv file, it failed. I tired in the cloud and self hosted (Source), the log in self-hosted is: ``` DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. for ep in entry_points().get(namespace, []): ``` <img width="380" alt="image" src="https://github.com/langgenius/dify/assets/43746574/f10acb4f-6714-47b6-af83-b39271a904fb"> ### ✔️ Expected Behavior The annotation was uploaded ### ❌ Actual Behavior Upload Failed
yindo added the 🐞 bug label 2026-02-21 17:29:26 -05:00
yindo closed this issue 2026-02-21 17:29:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 30, 2024):

🤖

Hey there @luzhouuu! Good to see you again. Hope your coding journey is going well. 😊

Thank you for reporting this issue. The error message you're seeing is a DeprecationWarning, which is typically not the cause of a program failure but rather a warning that a certain Python feature is being phased out.

The warning message suggests that the SelectableGroups dict interface is deprecated and the select method should be used instead. This is likely coming from a third-party library that dify is using, and not from dify itself.

As for the batch import failure, it's handled by the batch_import_annotations_task function in the dify codebase. This function is defined in the file api/tasks/annotation/batch_import_annotations_task.py. If there's an exception at any point during the batch import process, it rolls back the database session, sets the status of the indexing process in the Redis cache to 'error', logs the error message in the Redis cache, and logs the exception.

The expected format of the CSV file for batch import of annotations in dify is a two-column format where the first column represents the question and the second column represents the answer. The first row should contain the headers, which are 'question' and 'answer' for English language and '问题' and '答案' for Chinese language. The subsequent rows should contain the question and answer pairs.

If the CSV file you're trying to import matches this format and you're still experiencing issues, it would be helpful if you could provide more information about the CSV file and the exact steps you're taking to import it. This will help us better understand the issue and find a solution.

For more information, you can refer to the following sources:

I hope this helps! If you have any other questions or need further clarification, please let me know.

Sources


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.

@dosubot[bot] commented on GitHub (Jan 30, 2024): _🤖_ <!-- Greeting --> Hey there @luzhouuu! Good to see you again. Hope your coding journey is going well. 😊 <!-- Answer --> Thank you for reporting this issue. The error message you're seeing is a DeprecationWarning, which is typically not the cause of a program failure but rather a warning that a certain Python feature is being phased out. The warning message suggests that the `SelectableGroups dict interface` is deprecated and the `select` method should be used instead. This is likely coming from a third-party library that dify is using, and not from dify itself. As for the batch import failure, it's handled by the `batch_import_annotations_task` function in the dify codebase. This function is defined in the file `api/tasks/annotation/batch_import_annotations_task.py`. If there's an exception at any point during the batch import process, it rolls back the database session, sets the status of the indexing process in the Redis cache to 'error', logs the error message in the Redis cache, and logs the exception. The expected format of the CSV file for batch import of annotations in dify is a two-column format where the first column represents the question and the second column represents the answer. The first row should contain the headers, which are 'question' and 'answer' for English language and '问题' and '答案' for Chinese language. The subsequent rows should contain the question and answer pairs. If the CSV file you're trying to import matches this format and you're still experiencing issues, it would be helpful if you could provide more information about the CSV file and the exact steps you're taking to import it. This will help us better understand the issue and find a solution. For more information, you can refer to the following sources: - [CSV format](https://github.com/langgenius/dify/blob/main/web/app/components/app/annotation/batch-add-annotation-modal/csv-downloader.tsx) - [Batch import function](https://github.com/langgenius/dify/blob/main/api/tasks/annotation/batch_import_annotations_task.py) I hope this helps! If you have any other questions or need further clarification, please let me know. ## Sources - [web/app/components/app/annotation/batch-add-annotation-modal/csv-downloader.tsx](https://github.com/langgenius/dify/blob/main/web/app/components/app/annotation/batch-add-annotation-modal/csv-downloader.tsx) - [api/tasks/annotation/batch_import_annotations_task.py](https://github.com/langgenius/dify/blob/main/api/tasks/annotation/batch_import_annotations_task.py) --- 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.
Author
Owner

@JohnJyong commented on GitHub (Jan 30, 2024):

If possible, please provide your test files. We cannot reproduce the problem you mentioned. @luzhouuu

@JohnJyong commented on GitHub (Jan 30, 2024): If possible, please provide your test files. We cannot reproduce the problem you mentioned. @luzhouuu
Author
Owner

@luzhouuu commented on GitHub (Jan 31, 2024):

@JohnJyong Thanks for your reply, the upload failure occurred because I attempted to upload more than 5000 annotations at once.

@luzhouuu commented on GitHub (Jan 31, 2024): @JohnJyong Thanks for your reply, the upload failure occurred because I attempted to upload more than 5000 annotations at once.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1000