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

Đang mở
#877 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python, sqlite
Lĩnh vực
databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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'
Ngôn ngữ chính
Python
Star
117
Fork
115
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphnet-team/graphnet

Tất cả issue của graphnet-team/graphnet

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.