Different meanings set on values when reading null
See original GitHub issueHey, we have a list in our datastore with ids and sometimes nulls in it. Like here:
["null","null","a953c730fc2e4647b3a5b4e88fa4f0ce","59ce754ddf03401eb09abd50c977cf67","null"]
When we try to fetch them, we get the “Different meanings set on values within a list_value” Exception.
Is this a bug, that the method does not handles null?
def _get_meaning(value_pb, is_list=False):
meaning = None
if is_list:
# An empty list will have no values, hence no shared meaning
# set among them.
if len(value_pb.list_value) == 0:
return None
# We check among all the meanings, some of which may be None,
# the rest which may be enum/int values.
all_meanings = set(_get_meaning(sub_value_pb)
for sub_value_pb in value_pb.list_value)
meaning = all_meanings.pop()
# The value we popped off should have been unique. If not
# then we can't handle a list with values that have more
# than one meaning.
if all_meanings:
raise ValueError('Different meanings set on values '
'within a list_value')
elif value_pb.meaning: # Simple field (int32)
meaning = value_pb.meaning
return meaning
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
7 Things You Should Know About NULL Values - Biztory
A NULL value is a special marker used in SQL to indicate that a data value does not exist in the database. In...
Read more >A quick and thorough guide to 'null' - freeCodeCamp
If a reference points to null , it simply means that there is no value associated with it. Technically speaking, the memory location...
Read more >50 Shades of NULL – The Different Meanings of NULL in SQL
NULL can be: The “undefined” value, i.e., the value that is not yet defined (probably for technical reasons) but may well be defined...
Read more >What is a Null Set? - Video & Lesson Transcript - Study.com
Sometimes the null set is called the empty set as the sets contain no elements. These two definitions are used interchangeably.
Read more >What is a null set in mathematics? - TechTarget
In mathematical sets, the null set is a set that does not contain any values or elements. It is expressed as { }...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks. I’ll try to dig into it today (I am running a training so I may not get to it until the evening).
Also, for context,
_get_meaningand associated code were added in #1241.Also original design discussion (go to comment, issue is long). I’m trying to track down the discussion of the decision to use a single type for an entire list, but can’t find it.
@xamoom-raphael Can you provide a tiny
ndbsnippet? I’ll store my own data with the remote API and then check the raw output to see what would need to be done to accommodate.