ndexbio / ndex2-client

NDEx2 Client
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

In NiceCXNetwork.add_network_attribute() type not properly reset when adding duplicate attribute #50

Closed coleslaw481 closed 5 years ago

coleslaw481 commented 5 years ago

In NiceCXNetwork.add_network_attribute() it looks like there is a bug where if one adds a network attribute with a type say list_of_string like so:

net.add_network_attribute(name='foo', values=['a','b'], type='list_of_string')

and then add that attribute again without setting type:

net.add_network_attribute(name='foo', values='bar')

The type for that network_attribute will remain list_of_string cause type is only updated if the subsequent call has type set otherwise it is untouched.

The code should pop the 'd' datatype from dictionary if existing attribute is updated.

coleslaw481 commented 5 years ago

Fixed in UD-525 branch