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(get-python-api-code):fixing errors in a file uploading flow, as in issue #2799 #2815

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

vertgo
Copy link
Contributor

@vertgo vertgo commented Jul 18, 2024

fixed the code to allow a return value of 201
properly parse the components argument
handle the case of having no endpoint name to default to flow_id
changing the tweak value of path instead of file_path (correct for the file component)

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working javascript Pull requests that update Javascript code python Pull requests that update Python code labels Jul 18, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2815.dmtpw4p5recq1.amplifyapp.com

@@ -54,7 +54,7 @@ def upload_file(file_path: str, host: str, flow_id: str, components: list[str],
if response["file_path"]:
for component in components:
if isinstance(component, str):
tweaks[component] = {"file_path": response["file_path"]}
tweaks[component] = {"path": response["file_path"]}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @vertgo

file_path is the generic field reserved for paths in the Langflow's storage system. All file fields use this same attribute and path is not always used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Try reverting this and see if your tests still work. If not, then maybe keep path and we fix it later.

Copy link
Contributor Author

@vertgo vertgo Aug 9, 2024

Choose a reason for hiding this comment

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

if some components use file_path and others use path then we can set them both in tweaks, but i had changed it because it wasn't working (this was v.1.0.9, so that was a while ago)

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 8, 2024
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) August 8, 2024 13:53
Copy link
Contributor Author

@vertgo vertgo left a comment

Choose a reason for hiding this comment

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

this looks good to me

@ogabrielluiz ogabrielluiz merged commit 583bc74 into langflow-ai:main Aug 9, 2024
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer python Pull requests that update Python code size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants