Skip to content

Sqlite store delete wrong array #439

Closed

Description

@potter420

When there is multiple arrays in the same SqliteStore groups, if there exists 2 arrays named as follow: 'prefix', 'prefix_suffix.'
If there is a operation that overwrite on the array 'prefix', the array 'prefix_suffix' is removed too.

Minimal, reproducible code sample, a copy-pastable example if possible

import zarr
import numpy as np

path = 'D:/test.db'
store = zarr.SQLiteStore(path)
group = zarr.open_group(store)
group.array('prefix', np.arange(1000))
group.array('prefix_suffix', np.arange(100))
group['prefix_suffix']
Traceback (most recent call last):
  Python Shell, prompt 3, line 1
    # Used internally for debug sandbox under external interpreter
  File "d:\Program\Anaconda3\envs\dev\Lib\site-packages\zarr\hierarchy.py", line 333, in __getitem__
    raise KeyError(item)
builtins.KeyError: 'prefix_suffix'

Problem description

The prefix_suffix array should not be touched. This work well in directory store

Version and installation information

Please provide the following:

  • Value of 2.3.1
  • Value of 0.6.3
  • Version of Python interpreter : 3.7.2
  • Operating system Windows
  • How Zarr was installed "using conda"

Solution

By changing a few lines of SQL queries in SQLiteStore Class, I was able to circumvent the problem. But as I am completely new to GitHub, I did not know where to post the solution for testing.

Activity

  1. changed the title [-]Sqlite store delete wrong columns[/-] [+]Sqlite store delete wrong array[/+] on May 14, 2019
  2. jakirkham commented on May 14, 2019

    @jakirkham
    Member

    Ouch! Sorry for the trouble @potter420. If you already have a fix, would be happy to review a PR. If not, happy to take a closer look at this issue.

  3. added a commit that references this issue on May 15, 2019
  4. potter420 commented on May 15, 2019

    @potter420
    ContributorAuthor

    @jakirkham Thank you, I submitted a PR for this issue for review.
    #440

  5. added a commit that references this issue on May 16, 2019
  6. added
    bug
    on May 30, 2019
  7. jakirkham commented on Jan 9, 2020

    @jakirkham
    Member

    Fixed by PR ( #440 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions