Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

A condition on a list read over several hops ignores a depth given for the query on the SQL stores, while the load honours it

未关闭
#297 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
databases

调研方向

Start with drivine/backend/sql/sql_query_renderer.py:157, then compare its depth handling with drivine/backend/sql/sql_views.py:150 and drivine/dsl/query_renderer.py:304. Port ConditionDepthCrossEngineTest and ConditionDepthRenderingTest from the referenced work to cover query-specified depths, nested views, and rendered patterns. Done when conditions and loads agree across SQL and graph engines for the described depth cases.

由索引模型根据 Issue 内容生成。

描述

bug

Port of liberation-data/drivine4j#461.

What happens here now. A condition on a list of fragments read over several hops (max_depth above 1) walks the field's depth on every store, but on the SQL stores it ignores a depth given for the query (depth={"following": 3}), while the load honours it. So the filter and the load disagree whenever a query gives a depth:

  • drivine/backend/sql/sql_query_renderer.py:157 (the hop of a condition) takes depth = rel.max_depth.
  • The load reads self.depth.get(rel.field, rel.max_depth) (drivine/backend/sql/sql_views.py:150), and so does the Cypher condition (drivine/dsl/query_renderer.py:304).

With following of max_depth=2 over a → b → c → d and depth={"following": 3}, the load gives a's following as [b, c, d], and following.any(text == "d") doesn't find a on Postgres or Oracle; with depth={"following": 1} it finds a through c, which the load leaves out.

What the fix in drivine4j does (liberation-data/drivine4j#474): the load and every condition take the depth of a field from one place (RelationshipDepth.hops: the query's depth for the field, or its maxDepth, for a list of node fragments; one hop otherwise), on the graph engines and the SQL stores alike, at the top level and on a field of a nested view.

Tests that can be ported: ConditionDepthCrossEngineTest (the chain a → b → c → d, the cycle p → q → p, a stranger at the end and in the middle of a path, holders of the windows for a nested field; any, none, empty blocks, not, an or, depths 1 and 3 given for the query, and the count beside each filter), and ConditionDepthRenderingTest for the rendered patterns.

主要语言
Python
星标
1
派生
0
平均合并
1 小时 29 分钟
30 天内合并 PR
136

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

liberation-data/drivine-python 的其他 Issue

查看 liberation-data/drivine-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。