vesoft-inc / nebula-python

Client API of Nebula Graph in Python
191 stars 75 forks source link

add sphinx conf to auto generate python api doc #286

Closed Nicole00 closed 11 months ago

Nicole00 commented 11 months ago

run docs/build.sh to auto generate the nebula-python api doc. the doc looks like: image

wey-gu commented 11 months ago

This is a great milestone.

We could then:

wey-gu commented 11 months ago

Seems resp.space_name() == '' is expected in current master/nightly-build of NebulaGraph core?

    def test_2_reconnect(self):
        try:
            session = self.pool.get_session('root', 'nebula')
            time.sleep(2)

            # wait for the session space info to be updated to meta service
            session.execute(
                'CREATE SPACE IF NOT EXISTS test_session(vid_type=FIXED_STRING(8)); USE test_session;'
            )
            time.sleep(10)
            for i in range(0, 5):
                if i == 3:
                    os.system('docker stop tests_graphd0_1')
                    os.system('docker stop tests_graphd1_1')
                    time.sleep(3)
                resp = session.execute('SHOW SESSIONS')
                assert resp.is_succeeded(), resp.error_msg()
                assert resp.space_name() == 'test_session' #<---------------------
                time.sleep(2)
            session.release()
            new_session = self.pool.get_session('root', 'nebula')
            new_session.execute('SHOW SPACES')
        except Exception as e:
>           assert False, e
E           AssertionError: AssertionError("assert '' == 'test_session' #-----------
E               - test_session") 
E           assert False

If that's the case, let's remove this assert from UT.

Nicole00 commented 11 months ago

Seems resp.space_name() == '' is expected in current master/nightly-build of NebulaGraph core?

    def test_2_reconnect(self):
        try:
            session = self.pool.get_session('root', 'nebula')
            time.sleep(2)

            # wait for the session space info to be updated to meta service
            session.execute(
                'CREATE SPACE IF NOT EXISTS test_session(vid_type=FIXED_STRING(8)); USE test_session;'
            )
            time.sleep(10)
            for i in range(0, 5):
                if i == 3:
                    os.system('docker stop tests_graphd0_1')
                    os.system('docker stop tests_graphd1_1')
                    time.sleep(3)
                resp = session.execute('SHOW SESSIONS')
                assert resp.is_succeeded(), resp.error_msg()
                assert resp.space_name() == 'test_session' #<---------------------
                time.sleep(2)
            session.release()
            new_session = self.pool.get_session('root', 'nebula')
            new_session.execute('SHOW SPACES')
        except Exception as e:
>           assert False, e
E           AssertionError: AssertionError("assert '' == 'test_session' #-----------
E               - test_session") 
E           assert False

If that's the case, let's remove this assert from UT.

Seems resp.space_name() == '' is expected in current master/nightly-build of NebulaGraph core?

    def test_2_reconnect(self):
        try:
            session = self.pool.get_session('root', 'nebula')
            time.sleep(2)

            # wait for the session space info to be updated to meta service
            session.execute(
                'CREATE SPACE IF NOT EXISTS test_session(vid_type=FIXED_STRING(8)); USE test_session;'
            )
            time.sleep(10)
            for i in range(0, 5):
                if i == 3:
                    os.system('docker stop tests_graphd0_1')
                    os.system('docker stop tests_graphd1_1')
                    time.sleep(3)
                resp = session.execute('SHOW SESSIONS')
                assert resp.is_succeeded(), resp.error_msg()
                assert resp.space_name() == 'test_session' #<---------------------
                time.sleep(2)
            session.release()
            new_session = self.pool.get_session('root', 'nebula')
            new_session.execute('SHOW SPACES')
        except Exception as e:
>           assert False, e
E           AssertionError: AssertionError("assert '' == 'test_session' #-----------
E               - test_session") 
E           assert False

If that's the case, let's remove this assert from UT.

there's a test for multi-thread, it uses 50 threads to create space, causing the space is not enough for storaged. just fixed it. thanks @HarrisChu

codecov-commenter commented 11 months ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (1fe9a44) 77.51% compared to head (2fc9471) 77.51%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #286 +/- ## ======================================= Coverage 77.51% 77.51% ======================================= Files 18 18 Lines 2411 2411 ======================================= Hits 1869 1869 Misses 542 542 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.