3.1.0-alpha: requirements.txt pulls in Prefect 3 (SQLAlchemy>=2.0), conflicts with CKAN 2.10.3 SQLAlchemy 1.4.x
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python, sqlalchemy
- Lĩnh vực
- backend, build-system
Hướng nghiên cứu
The conflict comes from requirements.txt (the prefect>=3.7,<3.8 line) and from pyproject.toml, which reads dependencies from that file. Start by checking whether the plugin import chain in plugin.py and cli.py really avoids prefect and SQLAlchemy 2.0, as the report claims. Done means a pip install -e . into a venv pinned to CKAN 2.10.3 keeps sqlalchemy at 1.4.x and the ckan CLI starts. Splitting prefect into an optional extra is the likely fix, but confirm the design with maintainers first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Installing DataPusher+ 3.1.0-alpha into a CKAN venv per the README's "install as a CKAN extension" instructions upgrades SQLAlchemy to 2.x (pulled in transitively by prefect>=3.7,<3.8). This breaks CKAN core, since ckan/model/tag.py still does from sqlalchemy.orm import relation — relation was a deprecated alias for relationship() in SQLAlchemy 1.x and was removed in 2.0.
Environment
CKAN 2.10.3 (pins sqlalchemy[mypy]==1.4.41)
Python 3.10
DataPusher+ installed via:
pip3 install -e 'git+https://github.com/dathere/[email protected]#egg=datapusher-plus'
pip3 install -r 'https://raw.githubusercontent.com/dathere/datapusher-plus/3.1.0-alpha/requirements.txt'
into CKAN's existing venv (/usr/lib/ckan/default), as documented.
Steps to Reproduce
Set up CKAN 2.10.3 in a venv (SQLAlchemy 1.4.41 installed as part of CKAN's own requirements).
Install DataPusher+ 3.1.0-alpha and its requirements.txt into that same venv.
Run any ckan CLI command, e.g. ckan -c /etc/ckan/default/ckan.ini run.
Expected behavior
CKAN CLI starts normally; DataPusher+ is available as a CKAN plugin alongside it.
Actual behavior
Traceback (most recent call last):
File "/usr/lib/ckan/default/bin/ckan", line 3, in <module>
from ckan.cli.cli import ckan
File "/usr/lib/ckan/default/lib/python3.10/site-packages/ckan/cli/cli.py", line 12, in <module>
import ckan.plugins as p
File "/usr/lib/ckan/default/lib/python3.10/site-packages/ckan/plugins/__init__.py", line 3, in <module>
from ckan.plugins.core import * # noqa: re-export
File "/usr/lib/ckan/default/lib/python3.10/site-packages/ckan/plugins/core.py", line 21, in <module>
import ckan.plugins.interfaces as interfaces
File "/usr/lib/ckan/default/lib/python3.10/site-packages/ckan/plugins/interfaces.py", line 17, in <module>
from ckan.model.user import User
File "/usr/lib/ckan/default/lib/python3.10/site-packages/ckan/model/__init__.py", line 31, in <module>
from ckan.model.package import (
File "/usr/lib/ckan/default/lib/python3.10/site-packages/ckan/model/package.py", line 492, in <module>
from ckan.model import tag
File "/usr/lib/ckan/default/lib/python3.10/site-packages/ckan/model/tag.py", line 6, in <module>
from sqlalchemy.orm import relation
ImportError: cannot import name 'relation' from 'sqlalchemy.orm'
Root Cause
requirements.txt for 3.1.0-alpha includes:
prefect>=3.7,<3.8
Prefect 3.7.x requires sqlalchemy[asyncio]>=2.0,<3.0 (per PyPI metadata). When this is installed into a CKAN venv, pip upgrades SQLAlchemy from CKAN's pinned 1.4.x (1.4.41 on 2.10.3) to a 2.x release to satisfy Prefect's constraint.
CKAN core ( 2.10.x ) still relies on the SQLAlchemy 1.x relation alias in ckan/model/tag.py, which doesn't exist in SQLAlchemy 2.0. So any CKAN install with DP+ 3.1.0-alpha's full requirements.txt applied in the same environment is currently broken at the ckan CLI level — independent of CKAN version.
Workaround (proposed based on source inspection — needs verification)
Traced the import chain in the 3.1.0-alpha source: plugin.py imports cli.py at module load, but cli.py's prefect/prefect_client imports are all inside command function bodies (prefect_deploy, the worker-status check) — never executed at plugin-registration time (get_commands() just returns [datapusher_plus]). None of plugin.py's other imports (views, helpers, logic.action, logic.auth, config) touch prefect or SQLAlchemy 2.0. So the CKAN-plugin half of DP+ doesn't itself need SQLAlchemy 2.0 — only prefect-deploy / the worker side does.
The catch is that pyproject.tomldeclares dependencies = { file = ["requirements.txt"] } (via dynamic = ["dependencies", ...]), so even pip install -e . pulls in prefect → SQLAlchemy 2.0.
- Ngôn ngữ chính
- Python
- Star
- 47
- Fork
- 33
- Merge trung bình
- 2 giờ 28 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dathere/datapusher-plus
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dathere/datapusher-plus#359 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
"Total elapsed time" in the JOB DONE line is ~1.79 billion seconds (perf_counter overwrites the time.time() start)Có thể đã có người làm @tino097 đã nhận 14 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
dathere/datapusher-plus#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
FormulaProcessing stage always skipped on CKAN 2.10+: ckan.plugins is a list, stage calls .split() on itCó thể đã có người làm @tino097 đã nhận 14 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
dathere/datapusher-plus#354 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
dathere/datapusher-plus#340 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Prefect requires Sqlalchemy2Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 53/100
dathere/datapusher-plus#338 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của dathere/datapusher-plus
Issue tương tự
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gke-labs/kube-agents#5671 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(auth): Method B step 4 should tell users to tick "Use this client for an AI-powered agent"Đang mởdocumentation next-release v0.9.6
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
khuisman/mcp-gee-sweet#1446 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
In-box secret files written before their chmod: lc-creds, stacks tee, and the workspace tokenĐang mởmodel:sonnet runtime:claude security size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
FootprintAI/Containarium#3671 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HolidayBase: reassigning `language` does not re-initialize translations or re-populate holidaysCó thể đã có người làm @shikhabhadoria đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vacanza/holidays#4116 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CLI exec
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày