Commit 3559fc9
authored
Remove auto-flattening for unpack_arcs. (#244)
Currently the auto-flattening of unpack_arcs leads to the following
scenario:
Two properties are requested for a given entity but data only exists for
one of the properties. The REST api will not contain the property with
no data in the response, therefore we cannot tell **from only the
response** the difference between one property requested and one
property out of multiple properties requested contains data.
An example:
```
node_resp = dc_client.node.fetch(node_dcids="bio/APOE", expression="<-[encodesGene,variantID]")
node_resp.get_properties()
> {'bio/APOE': [Node(dcid='bio/AB035149.1', name='AB035149.1', provenanceId='dc/base/NCBI_Gene'...), ...] ...}
```
In the response from get_properties(), we can't tell if it's for
encodesGene or variantID.
A long term fix for this would be to store the original requested
properties in the NodeResponse object and only do this "autoflattening"
when there was one **requested** property. However, another
consideration is that many return types for a single method can cause a
lot confusion.1 parent 338000c commit 3559fc9
2 files changed
Lines changed: 15 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | | - | |
| 15 | + | |
14 | 16 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
28 | | - | |
| 24 | + | |
| 25 | + | |
29 | 26 | | |
30 | 27 | | |
31 | 28 | | |
| |||
0 commit comments