vesoft-inc / nebula-python

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

Feature/add typing #221

Closed alan890104 closed 2 years ago

alan890104 commented 2 years ago

I've done two things in commits for improving user experience on nebula-python.

  1. add typing for DataObject.ValueWrapper
  2. add recursive paring for example/FormatResp
CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

wey-gu commented 2 years ago

Wow, the cast is sweet and awesome @alan890104 thanks!

Could you please check its linting with make fmt-check?

alan890104 commented 2 years ago

No problem. Done.

wey-gu commented 2 years ago

@alan890104 could you please check its tests, where a docker/docker-compose env is required here.

docker-compose -f docker-compose.yaml up -d
sleep 45
pytest -s -v -k "not SSL"
alan890104 commented 2 years ago

ok i'll check it

alan890104 commented 2 years ago

@wey-gu I found that python3.6 does not support this statement

from __future__ import annotations

so I change the order of ValueWrapper and delete import to support python 3.6

wey-gu commented 2 years ago

@wey-gu I found that python3.6 does not support this statement

from __future__ import annotations

so I change the order of ValueWrapper and delete import to support python 3.6

Sorry for staying in a non-modern python version to enable proper typing handling in runtime. Thanks for your time struggling on this.

HarrisChu commented 2 years ago

why change the code order in last commit?

alan890104 commented 2 years ago

@wey-gu I found that python3.6 does not support this statement

from __future__ import annotations

so I change the order of ValueWrapper and delete import to support python 3.6

@HarrisChu In order to add typings for ValueWrapper, I have to change the code order. Or it will cause class-name-forward-reference error.

HarrisChu commented 2 years ago

you can use:

    def as_node(self) -> "Node":
alan890104 commented 2 years ago

@HarrisChu I revert my commit and fix the typing as you said. Tks!

HarrisChu commented 2 years ago

LGTM