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

Eng 588 [Server] allow users to upload csvs to demo #82

Conversation

eunice-chan
Copy link
Contributor

@eunice-chan eunice-chan commented Jun 10, 2022

#82 -- BE API endpoint to create table in demo DB from CSV
#83 -- FE UI to allow upload of CSV to demo DB
#55 -- FE Integrations Details page where this functionality lives

…om:aqueducthq/aqueduct into eng-588-allow-users-to-upload-csvs-to-demo-be
@vsreekanti
Copy link
Contributor

A small request on PR naming @eunice-chan -- when we're stacking multiple PRs like this, it would be great if we included the system component in the title. Otherwise, it's kinda difficult to tell which one is which. e.g., #83 could be titled "ENG 588: [UI] Allow users to upload CSVs to demo DB" and #82 could be titled "ENG 588: [Server] Add endpoint for accepting and uploading new table". Does that make sense?

@eunice-chan eunice-chan changed the title Eng 588 allow users to upload csvs to demo be Eng 588 [Server] allow users to upload csvs to demo Jun 10, 2022
…om:aqueducthq/aqueduct into eng-588-allow-users-to-upload-csvs-to-demo-be
…om:aqueducthq/aqueduct into eng-588-allow-users-to-upload-csvs-to-demo-be
Copy link
Contributor

@likawind likawind left a comment

Choose a reason for hiding this comment

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

Most parts makes sense! I think my main concern is the fact we convert csv content directly to a jobSpec field and read that field in python. This may not be a reliable solution for two reasons:

Alternatively we can store the csv content in some path using store.Put(), and use the existing load operator to create the table by passing the file path as the upstream artifact.

  • Another thing to mention is typically byte -> string [transmit] string -> byte conversion is not that reliable when transmitted across systems (e.g. go server and python executor) as the same string could have different encodings. Using base64 encoding / decoding for byte -> string conversion part will be much reliable since base64 produces ASCII only characters which are the same across all systems. Since we will put the content in store, we don't need to worry about this if we use the alternative solution.

src/golang/cmd/server/server/create_table.go Outdated Show resolved Hide resolved
src/golang/cmd/server/handler/create_table.go Show resolved Hide resolved
src/golang/cmd/server/handler/create_table.go Outdated Show resolved Hide resolved
…om:aqueducthq/aqueduct into eng-588-allow-users-to-upload-csvs-to-demo-be
…om:aqueducthq/aqueduct into eng-588-allow-users-to-upload-csvs-to-demo-be
@eunice-chan eunice-chan requested a review from likawind June 11, 2022 23:19
contentPath := fmt.Sprintf("create-table-content-%s", args.RequestId)
if err := storage.NewStorage(h.StorageConfig).Put(ctx, contentPath, args.csv); err != nil {
return nil, http.StatusInternalServerError, errors.Wrap(err, "Cannot save CSV.")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

let's add a defer storage.Delete(path) to always delete the file once the upload is completed

Copy link
Contributor

@likawind likawind left a comment

Choose a reason for hiding this comment

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

Great work, appreciate the fast update! I assumed you've tested your updates? Just left one minor suggestion but I think it's generally good to go!

@eunice-chan eunice-chan merged commit f8e17a8 into eng-588-allow-users-to-upload-csvs-to-demo Jun 13, 2022
@eunice-chan eunice-chan deleted the eng-588-allow-users-to-upload-csvs-to-demo-be branch June 16, 2022 16:05
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.

3 participants