GFQL Cypher: literal -0.0 evaluates to +0.0 on pandas (unary minus as 0 - x)

オープン 初心者向け
#2,334 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
pandas, python
領域
backend

調査の方向性

式 evaluator の _gfql_eval_expr_ast_values の単項マイナス分岐から始めます。ここでは否定が 0 - operand として書き換えられているので、ゼロの符号が保持されるように、オペランドの真の否定に変更します。既存の GFQL/Cypher evaluator テストを見つけ、RETURN -0.0 と 0.0 * -1.0 のケースを追加し、== ではなく math.copysign で符号を assert します。完了とは、両方の式が -0.0 を返し、周囲の evaluator スイートが引き続き通ることを意味します。

索引モデルが issue の本文から書いたものです。

説明

bug gfql

Summary

A literal -0.0 in a Cypher row expression evaluates to +0.0 on pandas.

Repro (master 73a9ecbf1, pandas; verified on the DGX)

RETURN -0.0 AS v          -- actual 0.0 with sign +; expected -0.0
RETURN 0.0 * -1.0 AS v    -- -0.0 (correct)

Likely cause

Unary minus is evaluated as 0 - operand in _gfql_eval_expr_ast_values. In IEEE 754, 0 - 0.0 is +0.0, whereas negation gives -0.0.

Expected

Unary minus negates. The result keeps the sign of zero, matching openCypher and the other engines.

Notes

  • Low impact. It is visible through 1/x (inf vs -inf) and through sign-sensitive comparisons and formatting.
  • #2328 makes only the WITH n, $v whole-param projection path exact for -0.0. The evaluator fix belongs in a small side PR.
主要言語
Python
スター
2.6k
フォーク
229
平均マージ
19時間 7分
マージ済み PR(30日)
59

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphistry/pygraphistry のほかの issue

graphistry/pygraphistry の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。