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

fix: datasets documents update-by-file api missing assign field 'indexing_technique' internally #14243

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

StrayDragon
Copy link
Contributor

@StrayDragon StrayDragon commented Feb 24, 2025

Summary

when post /datasets/{dataset_id}/documents/{document_id}/update-by-file with only name and file filed, i got error:

{
  "code": "invalid_param",
  "message": "1 validation error for KnowledgeConfig\nindexing_technique\n  Field required [type=missing, input_value={'doc_form': 'text_model'...45c5-b58f-642ae837a9b9'}, input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.9/v/missing",
  "status": 400
}

this pr fix this problem just like

# indexing_technique is already set in dataset since this is an update
args["indexing_technique"] = dataset.indexing_technique
do

to fix #14266

Screenshots

see Summary

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working labels Feb 24, 2025
@StrayDragon
Copy link
Contributor Author

hey, I just checked the contribution guidelines. @guchenhe @crazywoola seem to be the right fit for this PR.

Not sure if you're free to check my PR. If it works for you, would you mind giving it a look?

Thank you!

@crazywoola
Copy link
Member

@StrayDragon Please open an issue or link an existing issue in the description.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 24, 2025
@StrayDragon
Copy link
Contributor Author

@StrayDragon Please open an issue or link an existing issue in the description.

ok, i have created a new issue ( #14266 ) after searched exist issues.
Please deal with it when you have time. Thank you!

@crazywoola crazywoola merged commit b15ff4e into langgenius:main Feb 24, 2025
6 checks passed
@StrayDragon StrayDragon deleted the l8ng/fix-datasets-api branch February 24, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dataset API ".../update-by-file" fails normal requests due to an unnecessary required field validation
2 participants