TypeError: __new__() got an unexpected keyword argument 'latitude'
raphaelLacerda opened this issue · 7 comments
Expected Behavior (Mandatory)
I was using neomodel 4.0.8, python 3.9 and this code was working.
location = PointProperty(required=False, crs='wgs-84')
def create_location(self, lat, long):
self.location = NeomodelPoint(latitude=lat, longitude=long)
My working pipfile
neomodel = { extras = ["extras"], version = "==4.0.8" }
Actual Behavior (Mandatory)
When i upgraded to neomodel 5.0.1, shapely 2.0.1, I got this error
> self.location = NeomodelPoint(latitude=lat, longitude=long)
E TypeError: __new__() got an unexpected keyword argument 'latitude'
My pipfile
neomodel = { extras = ["extras"], version = "==5.0.1" }
shapely = "==2.0.1"
To run another set of tests, I got the example from the doc
https://neomodel.readthedocs.io/en/latest/spatial_properties.html#working-with-pointproperty
from neomodel import UniqueIdProperty
from neomodel.contrib.spatial_properties import PointProperty, NeomodelPoint
import neomodel
class SomeEntity(neomodel.StructuredNode):
entity_id = UniqueIdProperty()
location = PointProperty(crs='wgs-84')
if __name__ == '__main__':
my_entity = SomeEntity(location=NeomodelPoint((0.0,0.0), crs='wgs-84'))
print(my_entity.location)
Pipfile
[packages]
shapely = "==2.0.1"
neomodel = { extras = ["extras"], version = "==5.0.1" }
neo4j = "==4.4.5"
And I got the following error:
my_entity = SomeEntity(location=NeomodelPoint((0.0,0.0), crs='wgs-84'))
TypeError: __new__() got an unexpected keyword argument 'crs'
Does anyone know how to fix this problem?
If it's a bug related or a compatibility version problem between shapely and neomodel
The code above with this Pipfile works fine
shapely = "==1.8.1"
neomodel = { extras = ["extras"], version = "==4.0.10" }
neo4j = "==4.4.5"
Versions
- OS:
- Library: neomodel: 5.0.1
- Neo4j: neo4j:4.4.21
Thanks for bringing this up, it probably is a compatibility error, can you afford (for the moment) shapely < 2.0 ? Will have a look at it tomorrow.
The code above with this Pipfile works fine
shapely = "==1.8.1"
neomodel = { extras = ["extras"], version = "==4.0.10" }
neo4j = "==4.4.5"
this combination worked fine too
[packages]
shapely = "==1.8.5"
neomodel = { extras = ["extras"], version = "==5.0.1" }
neo4j = "==4.4.5"
@raphaelLacerda I have tracked down the cause, will be able to provide a fix in the next couple of days, I need to think about this a bit more to preserve backwards compatibility.
Quick update: Still on this one, will try to get the PR out today, I am down to one test failure but it is an important one and other things require my attention at the same time. Neverthless, interesting curve ball this one.
@raphaelLacerda Please see here
We just released 5.1.0, which includes bumping to Shapely >= 2.0