dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.55k stars 1.45k forks source link

AttributeError: module 'pendulum' has no attribute 'POST_TRANSITION' #21767

Closed cmpadden closed 5 months ago

cmpadden commented 5 months ago

Dagster version

1.7.4

What's the issue?

Unable to run dagster command:

(root) [root@dagster ~]# dagster --version
Traceback (most recent call last):
  File "/root/.venv/bin/dagster", line 5, in <module>
    from dagster.cli import main
  File "/root/.venv/lib/python3.9/site-packages/dagster/__init__.py", line 82, in <module>
    from dagster._config.config_schema import ConfigSchema as ConfigSchema
  File "/root/.venv/lib/python3.9/site-packages/dagster/_config/__init__.py", line 5, in <module>
    from .config_type import (
  File "/root/.venv/lib/python3.9/site-packages/dagster/_config/config_type.py", line 6, in <module>
    from dagster._annotations import public
  File "/root/.venv/lib/python3.9/site-packages/dagster/_annotations.py", line 8, in <module>
    from dagster._core.decorator_utils import (
  File "/root/.venv/lib/python3.9/site-packages/dagster/_core/decorator_utils.py", line 30, in <module>
    from dagster._core.errors import DagsterInvalidDefinitionError
  File "/root/.venv/lib/python3.9/site-packages/dagster/_core/errors.py", line 23, in <module>
    from dagster._utils.interrupts import raise_interrupts_as
  File "/root/.venv/lib/python3.9/site-packages/dagster/_utils/__init__.py", line 52, in <module>
    import dagster._seven as seven
  File "/root/.venv/lib/python3.9/site-packages/dagster/_seven/__init__.py", line 17, in <module>
    from .compat.pendulum import PendulumDateTime as PendulumDateTime  # re-exported
  File "/root/.venv/lib/python3.9/site-packages/dagster/_seven/compat/pendulum.py", line 22, in <module>
    POST_TRANSITION = pendulum.tz.POST_TRANSITION if _IS_PENDULUM_3 else pendulum.POST_TRANSITION
AttributeError: module 'pendulum' has no attribute 'POST_TRANSITION'

What did you expect to happen?

Expected to be able to run dagster as all dependencies are installed.

How to reproduce?

(root) [root@dagster ~]# python --version
Python 3.9.18
(root) [root@dagster ~]# uv --version
uv 0.1.15
Running in a virtual environment:
(root) [root@dagster ~]# uv venv --python python3.9
(root) [root@dagster ~]# source .venv/bin/activate
(root) [root@dagster ~]# uv pip install dagster dagster-webserver

Deployment type

Local

Deployment details

I don't think the operating system is the root of the error, but I'm not ruling it out. This error is occurring from an iocage jail on FreeBSD.

(root) [root@dagster ~]# freebsd-version
13.3-RELEASE-p2

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

gibsondan commented 5 months ago

Are you certain that you are on dagster 1.7.4? I am fairly confident that this issue is fixed on that version.

cmpadden commented 5 months ago

Are you certain that you are on dagster 1.7.4? I am fairly confident that this issue is fixed on that version.

I'm unable to run dagster --version, but see that version in the uv pip freeze, and version.py.

(root) [root@dagster ~]# which dagster
/root/.venv/bin/dagster
(root) [root@dagster ~]# cat .venv/lib/python3.9/site-packages/dagster/version.py
__version__ = "1.7.4"
(root) [root@dagster ~]# uv pip freeze | grep dagster
dagster==1.7.4
dagster-graphql==1.7.4
dagster-pipes==1.7.4
dagster-webserver==1.7.4
gibsondan commented 5 months ago

Ah I was thinking this was https://github.com/dagster-io/dagster/discussions/18783 but maybe it is something else

gibsondan commented 5 months ago

What version of pendulum do you have installed?

On Thu, May 9, 2024 at 8:52 PM gibsondan @.***> wrote:

Ah I was thinking this was #18783 https://github.com/dagster-io/dagster/discussions/18783 but maybe it was something else

— Reply to this email directly, view it on GitHub https://github.com/dagster-io/dagster/issues/21767#issuecomment-2103707445, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAPJC46AAFINR3OUDL6PF3ZBQR6ZAVCNFSM6AAAAABHPWMEK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBTG4YDONBUGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cmpadden commented 5 months ago

What version of pendulum do you have installed?

It's on pendulum==3.0.0.

Here's the full pip freeze.

(root) [root@dagster ~]# uv pip freeze
alembic==1.13.1
aniso8601==9.0.1
annotated-types==0.6.0
anyio==4.3.0
backoff==2.2.1
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
coloredlogs==14.0
croniter==2.0.5
dagster==1.7.4
dagster-graphql==1.7.4
dagster-pipes==1.7.4
dagster-webserver==1.7.4
docstring-parser==0.16
exceptiongroup==1.2.1
filelock==3.14.0
fsspec==2024.3.1
gql==3.5.0
graphene==3.3
graphql-core==3.2.3
graphql-relay==3.2.0
greenlet==3.0.3
grpcio==1.63.0
grpcio-health-checking==1.62.2
h11==0.14.0
httptools==0.6.1
humanfriendly==10.0
idna==3.7
jinja2==3.1.4
mako==1.3.3
markdown-it-py==3.0.0
markupsafe==2.1.5
mdurl==0.1.2
multidict==6.0.5
packaging==24.0
pendulum==3.0.0
protobuf==4.25.3
pydantic==2.7.1
pydantic-core==2.18.2
pygments==2.18.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.1
pyyaml==6.0.1
requests==2.31.0
requests-toolbelt==1.0.0
rich==13.7.1
setuptools==69.5.1
six==1.16.0
sniffio==1.3.1
sqlalchemy==2.0.30
starlette==0.37.2
structlog==24.1.0
tabulate==0.9.0
time-machine==2.14.1
tomli==2.0.1
toposort==1.10
tqdm==4.66.4
typing-extensions==4.11.0
tzdata==2024.1
universal-pathlib==0.2.2
urllib3==2.2.1
uvicorn==0.29.0
uvloop==0.19.0
watchdog==4.0.0
watchfiles==0.21.0
websockets==12.0
yarl==1.9.4
cmpadden commented 5 months ago

When I throw that into a requirements.txt and install it into a matching python 3.9.18 venv on an m1 mac it works fine. How bizarre.

cmpadden commented 5 months ago

It turns out this was due to a corrupt installation of pendulum. There was no __version__ attribute in the module. Installing via pip (not uv pip) seems to have done the trick. Perhaps this is some weird FreeBSD corner case.

Apologies for the false alarm, and thanks for the quick response @gibsondan!