vesoft-inc / nebula-python

Client API of Nebula Graph in Python
194 stars 76 forks source link

feature/auto-cast #222

Closed alan890104 closed 2 years ago

alan890104 commented 2 years ago
  1. Add method cast in ValueWrapper for automatically casting to python basic type
  2. Add and pass unit test for cast method
  3. Add examples and README

For the most efficient way, we should call cast in every iterable method over their items, (e.g. calling cast in as_list() ). However, the returned type will change and cause incompatible. So I try to preserve the if-else statement in a better way, and recursively call cast when _value is iterable