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

Add upload_csv route #61

Merged
merged 5 commits into from
Sep 6, 2023
Merged

Add upload_csv route #61

merged 5 commits into from
Sep 6, 2023

Conversation

bh2smith
Copy link
Collaborator

@bh2smith bh2smith commented Sep 5, 2023

This PR adds CSV upload functionality to the API client.

Unfortunately, it appears, I have the ability to completely overwrite other users tables... Not sure if this was intended. cc @msf

Tests are failing, because I assumed I would get a False success response when trying to overwrite someone else's table.

Closes #67

Remaining Question: Do we also was to update the async client? If so, it would probably need more work since it has not been kept updated like the other.

@bh2smith bh2smith requested a review from msf September 5, 2023 13:44
@bh2smith bh2smith force-pushed the upload-csv branch 2 times, most recently from 0146d70 to 9628db7 Compare September 5, 2023 17:33
@bh2smith bh2smith changed the base branch from main to skip-crud-tests September 5, 2023 17:37
@bh2smith bh2smith changed the base branch from skip-crud-tests to main September 5, 2023 19:36
@@ -9,7 +9,6 @@
from typing import Dict


# pylint: disable=too-few-public-methods
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is no longer needed (thought I would sneak it in here).

@dsalv
Copy link

dsalv commented Sep 6, 2023

This PR adds CSV upload functionality to the API client.

Unfortunately, it appears, I have the ability to completely overwrite other users tables... Not sure if this was intended. cc @msf

Tests are failing, because I assumed I would get a False success response when trying to overwrite someone else's table.

Closes #67

Remaining Question: Do we also was to update the async client? If so, it would probably need more work since it has not been kept updated like the other.

The ability to overwrite other people's tables under dune_upload is the intended behavior. Tables cannot be overwritten if they are under users' personal namespaces (e.g. dune.bh2smith.dataset_{table_name}). We introduced personal namespaces last week. I am not sure that would be helpful in your tests

"""
response_json = self._post(
route="/table/upload/csv",
params={
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dsalv how do we specify the namespace the table should be in?

Copy link

Choose a reason for hiding this comment

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

right now it is not possible to customize the namespace. All publicly visible tables go as dune_upload.{table_name}. All tables are also duplicated as dune.{username}.dataset_{table_name}.

The current plan is to keep the personal namespaces and deprecate dune_upload soon. There is no plan to support customizable namespaces at the moment. This needs to be escalated if we think customizable namespaces are critical

@bh2smith
Copy link
Collaborator Author

bh2smith commented Sep 6, 2023

So far, it looks like just commentary on intended functionality. At the moment the implementation and tests are aligned with the intended functionality. If its not blocking, I'd think we can merge as is and adjust later as necessary.

Please let me know if there is anything that should be changed here and feel free to approve if all is good.

Copy link
Collaborator

@msf msf left a comment

Choose a reason for hiding this comment

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

lgtm

@bh2smith bh2smith merged commit 4c2c256 into main Sep 6, 2023
4 checks passed
@bh2smith bh2smith deleted the upload-csv branch September 6, 2023 14:00
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.

Add upload_csv
3 participants