Skip to content

Commit

Permalink
feat: add three database interfaces and usecases
Browse files Browse the repository at this point in the history
Signed-off-by: heiliuchao <[email protected]>
  • Loading branch information
heiliuchao committed Mar 23, 2024
1 parent 68f5d12 commit 1150cde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions opengemini_client/client_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ def query(self, query: Query) -> QueryResult:

for result in json_data.get('results', []):
series_list: List[Series] = [
Series(name=series['name'], columns=series['columns'], values=series['values'])
Series(columns=series['columns'], values=series['values'])
for series in result.get('series', [])
if series.get('values', []) or series.get('name', [])
if series.get('values', [])
]
series_result = SeriesResult(series=series_list)
results.append(series_result)
Expand Down
11 changes: 6 additions & 5 deletions opengemini_client/retention_policy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ def test_show_rp_on_empty_dbname(self):
cli.show_retention_policy('')
cli.close()

# def test_show_rp_success(self):
# cli = test_util.get_test_default_client()
# cli.create_database(self.dbname)
# cli.show_retention_policy(dbname=self.dbname)
# cli.close()
def test_show_rp_success(self):
cli = test_util.get_test_default_client()
cli.create_database(self.dbname)
qr = cli.show_retention_policy(dbname=self.dbname)
self.assertEqual(qr.error, None)
cli.close()

def test_alter_rp_success(self):
cli = test_util.get_test_default_client()
Expand Down

0 comments on commit 1150cde

Please sign in to comment.