pathwaycom / pathway

Python ETL framework for stream processing, real-time analytics, LLM pipelines, and RAG.
https://pathway.com
Other
2.84k stars 98 forks source link

[Bug]: Error in loading documents AttributeError: 'ParseUnstructured' object has no attribute 'executor' #27

Closed SaumyaRR8 closed 2 months ago

SaumyaRR8 commented 3 months ago

Steps to reproduce

Error in loading documents AttributeError: 'ParseUnstructured' object has no attribute 'executor'

Steps to reproduce:

  1. Clone this repo by Pathway https://github.com/pathway-labs/dropbox-ai-chat
  2. Follow the readme to setup the app and .env file
  3. Run the docker file using docker compose up to reproduce the error.
  4. Or Install dependencies using the pip and then run python main.py. image

Relevant log output

2024-03-21 11:10:11 /usr/local/lib/python3.11/site-packages/beartype/_util/hint/pep/utilpeptest.py:311: BeartypeDecorHintPep585DeprecationWarning: PEP 484 type hint typing.Sequence[str] deprecated by PEP 585. This hint is scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". For further commentary and alternatives, see also:
2024-03-21 11:10:11     https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations
2024-03-21 11:10:11   warn(
2024-03-21 11:10:11 /usr/local/lib/python3.11/site-packages/pathway/io/http/_server.py:669: UserWarning: delete_completed_queries arg of rest_connector should be set explicitly. It will soon be required.
2024-03-21 11:10:11   warn(
2024-03-21 11:10:13 Traceback (most recent call last):
2024-03-21 11:10:13   File "/app/main.py", line 12, in <module>
2024-03-21 11:10:13     app_api.run(host=host, port=port)
2024-03-21 11:10:13   File "/app/api.py", line 32, in run
2024-03-21 11:10:13     documents = input_data.select(texts=parser(pw.this.data))
2024-03-21 11:10:13                                         ^^^^^^^^^^^^^^^^^^^^
2024-03-21 11:10:13   File "/usr/local/lib/python3.11/site-packages/pathway/internals/udfs/__init__.py", line 194, in __call__
2024-03-21 11:10:13     return self.executor._apply_expression_type(
2024-03-21 11:10:13            ^^^^^^^^^^^^^
2024-03-21 11:10:13 AttributeError: 'ParseUnstructured' object has no attribute 'executor'

What did you expect to happen?

The main pipline was expected to start.

Version

0.2.1

Docker Versions (if used)

4.28.0

OS

Linux

On which CPU architecture did you run Pathway?

x86-64

KamilPiechowiak commented 3 months ago

Hey @SaumyaRR8, It seems that your pathway version is incorrect. Did you follow the instruction to install all packages using pip install --upgrade -r requirements.txt? What you found is actually a bug (so thank you!) and it will be fixed in the next release. For now please use version 0.8.2 that is specified in the project. Then everything should work.

SaumyaRR8 commented 3 months ago

Yes, all the instructions were followed. First the project was run through docker which itself ran pip install --upgrade -r requirements.txt. This version came while installing using a venv and the checking the version number using pip freeze I tried installing the specified version and this is the error I am getting. ERROR: Could not find a version that satisfies the requirement pathway==0.8.2 (from versions: 0.dev0, 0, 0.post1, 0.2.0, 0.2.1) ERROR: No matching distribution found for pathway==0.8.2

Python version = 3.8, system is wsl2 ubuntu 20.04

Few days ago things were working as expected in an another environment which I created using the same steps.

embe-pw commented 3 months ago

Python version = 3.8, system is wsl2 ubuntu 20.04

We do not support Python 3.8, you need to use at least Python 3.10.

(But this should not be a problem with the docker install, as it uses Python 3.11)

SaumyaRR8 commented 3 months ago

It is the same issue when using conda environment with python 3.12 as the base installation.

embe-pw commented 3 months ago

@SaumyaRR8, are you using the current version of the https://github.com/pathway-labs/dropbox-ai-chat repo? I believe there were fixes made in it recently to make sure correct versions of the dependencies are used.

SaumyaRR8 commented 3 months ago

It was cloned about 20 hours ago from the above repository.

KamilPiechowiak commented 3 months ago

You may have old images cached. Please remove them (they should be named dropbox-ai-chat-ui and dropbox-ai-chat-api if you didn't change the project name) and after the removal run docker compose up again.

berkecanrizai commented 3 months ago

Hey @SaumyaRR8 , you can build with docker-compose build --no-cache and then run with docker compose up.

With these dependencies, it should work inside the Docker.

The executor issue with the Parser will be fixed soon with new release.

dxtrous commented 3 months ago

Hey @berkecanrizai if/when the issue is fixed, let's be sure to mention this in the changelog and ask @SaumyaRR8 to verify.

KamilPiechowiak commented 2 months ago

@SaumyaRR8, did removing the old docker images help with resolving the issue? The new Pathway (0.8.5) was released recently that doesn't contain this bug, so you can try running it locally with the newest pathway version.

SaumyaRR8 commented 2 months ago

The new version of pathway is working fine. Thanks for resolving the issue.