llnl / llnl/Sina

Nested/Dictionary data values

Open
#6 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Hello,

It seems like it is possible to create a `Record` with a dictionary as its data value, but not possible to insert that `Record` into a `DataStore`. Here is a minimal example

```python
from sina.model import Record
from sina.datastore import create_datastore

rec = Record('a', 'A')
rec.data_values['field'] = {'b': 5, 'c': 6}

ds = create_datastore('test.sql')
ds.records.insert(rec)
```

returns

`ValueError: ['At least one data entry belonging to Record a has a dictionary for a value.Value: field']`

I figured this would not be allowed as each data can also have a `units` field, but I have heard that there is some sort of option to use nested data. If there is a way to do so I would love to know more. Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Record data_values assignment, create_datastore('test.sql'), and ds.records.insert(rec) path shown in the reproducer. Trace where dictionary values are rejected and determine whether nested values should be supported or documented as invalid; done means the intended behavior is consistent for Record creation and DataStore insertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.