Report a Dgraph Bug
What version of Dgraph are you using?
v20.07.0
Have you tried reproducing the issue with the latest release?
yes
What is the hardware spec (RAM, OS)?
Client: MacOS 10.13.6 16 GByte RAM
Server: Ubuntu 18.04 LTS 64 GByte RAM
Steps to reproduce the issue (command/config used to run Dgraph).
def testCities(self):
'''
test a list of cities
'''
cityJsonUrl="https://raw.githubusercontent.com/lutangar/cities.json/master/cities.json"
with urllib.request.urlopen(cityJsonUrl) as url:
cityList=json.loads(url.read().decode())
self.assertEqual(128769,(len(cityList)))
cityIter=iter(cityList)
limit=1000
if getpass.getuser()=="travis":
limit=10000
for i in range(limit):
city=next(cityIter)
city['dgraph.type']='City'
lat=city['lat']
lng=city['lng']
city['location']={'type': 'Point', 'coordinates': [lng,lat] }
#print("%d: %s" % (i,city))
dgraph=self.getDGraph()
dgraph.drop_all()
schema='''
name: string @index(exact) .
country: string .
lat: float .
lng: float .
location: geo .
type City {
name
country
lat
lng
location
}'''
dgraph.addSchema(schema)
dgraph.addData(obj=cityList,limit=limit,batchSize=250)
query='''{
# get cities
cities(func: has(name)) {
country
name
lat
lng
location
}
}
'''
queryResult=dgraph.query(query)
self.assertTrue('cities' in queryResult)
qCityList=queryResult['cities']
self.assertEqual(limit,len(qCityList))
dgraph.close()
see https://github.com/WolfgangFahl/DgraphAndWeaviateTest/blob/master/tests/testDgraph.py
Expected behaviour and actual result.
Location handling should work or give an understandable error message.
actual error message is:
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Input for predicate "location" of type scalar is uid. Edge: entity:16515 attr:"location" value_type:UID value_id:16514 "
debug_error_string = "{"created":"@1597226020.750128000","description":"Error received from peer ipv6:[2003:c5:b70c:d00:7994:148e:9f98:bd94]:9080","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"Input for predicate "location" of type scalar is uid. Edge: entity:16515 attr:"location" value_type:UID value_id:16514 ","grpc_status":2}"
>
the other example “testCountries” works fine.
{
# get locations
locations(func: has(name)) {
country
name
lat
lng
location
}
}