Multiple SQLite files cannot be passed into the constructor of a single SQLite dataset object

オープン
#877 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python, sqlite
領域
databases

調査の方向性

Start with src/graphnet/data/dataset/sqlite/sqlite_dataset.py, especially the _get_all_indices and _establish_connection methods around the traceback locations. Reproduce by constructing an SQLiteDataset with multiple paths and check how index initialization accesses _indices. Done means the dataset can index the supplied database files without raising the reported AttributeError; the issue does not name a test to run.

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

説明

bug

Describe the bug
If a list of files is passed as the path argument of SQLiteDataset, in the process of defining SQLiteDataset._indices, SQLiteDataset._indices is referenced (this line), causing an error.

To Reproduce
Steps to reproduce the behavior:
Try to instatiate an SQLiteDataset and pass in a list of files to path.

Expected behavior
SQLiteDataset should be able to index the database files that are passed into it.

Full traceback
Please include the full error message to allow for debugging

File "<stdin>", line 1, in <module>
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/utilities/config/dataset_config.py", line 254, in __call__
    created_obj = super().__call__(*args, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/data/dataset/dataset.py", line 419, in __init__
    self._indices = self._get_all_indices()
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/data/dataset/sqlite/sqlite_dataset.py", line 87, in _get_all_indices
    self._establish_connection(0)
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/data/dataset/sqlite/sqlite_dataset.py", line 117, in _establish_connection
    indices = self._indices[i]
              ^^^^^^^^^^^^^
AttributeError: 'SQLiteDataset' object has no attribute '_indices'
主要言語
Python
スター
117
フォーク
115
平均マージ
2日 21時間
マージ済み PR(30日)
1

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

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

graphnet-team/graphnet のほかの issue

graphnet-team/graphnet の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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