Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete DataSet SDK implementation #2171

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Complete DataSet SDK implementation #2171

merged 2 commits into from
Aug 30, 2024

Conversation

Feiue
Copy link
Contributor

@Feiue Feiue commented Aug 30, 2024

What problem does this PR solve?

Complete DataSet SDK implementation
#1102

Type of change

  • New Feature (non-breaking change which adds functionality)

return get_data_error_result(
retmsg="Delete dataset error.(Database error)")
return get_json_result(data=True)
retmsg="id is required")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if "id" not in req: return get_data_error_result(retmsg="id is required")



@manager.route('/list', methods=['GET'])
@token_required
def list_datasets(tenant_id):
page_number = int(request.args.get("page", 1))
items_per_page = int(request.args.get("page_size", 1024))
orderby = request.args.get("orderby", "create_time")
orderby = request.args.get("orderby", "create_by")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
orderby = request.args.get("orderby", "create_by")
orderby = request.args.get("orderby", "create_time")

desc = bool(request.args.get("desc", True))
tenants = TenantService.get_joined_tenants_by_user_id(tenant_id)
kbs = KnowledgebaseService.get_by_tenant_ids(
[m["tenant_id"] for m in tenants], tenant_id, page_number, items_per_page, orderby, desc)
return get_json_result(data=kbs)
renamed_list = []
if kbs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this 'if' nessasary?



@manager.route('/detail', methods=['GET'])
@token_required
def detail(tenant_id):
req = request.args
key_mapping = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is good. Respect!

@KevinHuSh KevinHuSh merged commit 2c771fb into infiniflow:main Aug 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants