-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
return get_data_error_result( | ||
retmsg="Delete dataset error.(Database error)") | ||
return get_json_result(data=True) | ||
retmsg="id is required") |
There was a problem hiding this comment.
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")
api/apps/sdk/dataset.py
Outdated
|
||
|
||
@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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orderby = request.args.get("orderby", "create_by") | |
orderby = request.args.get("orderby", "create_time") |
api/apps/sdk/dataset.py
Outdated
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: |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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!
### What problem does this PR solve? Complete DataSet SDK implementation infiniflow#1102 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: Feiue <[email protected]>
What problem does this PR solve?
Complete DataSet SDK implementation
#1102
Type of change