langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
43.34k stars 6k forks source link

日志提示/app/api/core/rag/extractor/csv_extractor.py:60: FutureWarning错误 #4747

Closed WangJing1900 closed 3 months ago

WangJing1900 commented 3 months ago

Self Checks

Dify version

0.6.9

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

日志提示如下问题: df = pd.read_csv(csvfile, error_bad_lines=False, self.csv_args) /app/api/core/rag/extractor/csv_extractor.py:60: FutureWarning: The error_bad_lines argument has been deprecated and will be removed in a future version. Use on_bad_lines in the future. df = pd.read_csv(csvfile, error_bad_lines=False, self.csv_args)

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 3 months ago

@WangJing1900 Hello there! I'm here to help you with any bugs, questions, or contributions you might have for the repository. Let me know how I can assist you!

To resolve the FutureWarning error in your self-hosted (Docker) Dify version 0.6.9, you need to update the code in /app/api/core/rag/extractor/csv_extractor.py at line 60 to use the on_bad_lines argument instead of error_bad_lines. Here is the updated code:

Replace the existing line 60:

df = pd.read_csv(csvfile, error_bad_lines=False, **self.csv_args)

with the updated line:

df = pd.read_csv(csvfile, on_bad_lines='skip', **self.csv_args)

This change will resolve the FutureWarning error [1].

#### Details **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.

To continue the conversation, mention @dosu.

WangJing1900 commented 3 months ago

我使用ChatGPT回答的也是提示这样方式解决,但是我改了以后重启了服务器和docker,还是提示之前的错误,感觉修改的内容没有生效。

dosubot[bot] commented 3 months ago

要确保对 /app/api/core/rag/extractor/csv_extractor.py 的更改正确应用,请按照以下步骤操作:

  1. 重建 Docker 镜像: 进入包含 Dockerfile 的目录,并运行以下命令以重建 Docker 镜像:

    docker build -t your_image_name .
  2. 重启 Docker 容器: 重建镜像后,使用新镜像重启 Docker 容器。首先,停止现有容器:

    docker stop your_container_name

    然后,删除已停止的容器:

    docker rm your_container_name

    最后,使用更新的镜像运行新容器:

    docker run -d --name your_container_name your_image_name

通过这些步骤,确保 /app/api/core/rag/extractor/csv_extractor.py 中的更改包含在新的 Docker 镜像中,并在容器重启时正确应用[1]

#### Details **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.

To continue the conversation, mention @dosu.