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

Read CSV columns from uploaded file #45

Merged
merged 12 commits into from
Oct 10, 2024
Merged

Read CSV columns from uploaded file #45

merged 12 commits into from
Oct 10, 2024

Conversation

mccalluc
Copy link
Contributor

@mccalluc mccalluc commented Oct 4, 2024

  • Fix Parse uploaded CSV and return column headers #38
  • More CLI input validation, to save trouble downstream
  • For now, not worrying about the UI error if no file is provided: Down the road, the columns aren't even used on the first tab, but it makes debugging easier to have everything in one place temporarily
  • Drop the CWD when starting the app, so relative paths supplied on the CLI resolve the same way inside the app
  • Unit tests of CSV parsing, input validation
  • Add file upload to end-to-end test

The pairs of reactive.calc and render.text functions seem redundant, but I ran into trouble when I tried to apply both decorators to one function. When I feel more confident about how I'm using the library may ask about this in one of the forums.

@mccalluc mccalluc requested a review from ekraffmiller October 4, 2024 22:01
dp_creator_ii/__init__.py Show resolved Hide resolved
@@ -29,13 +37,12 @@ def get_arg_parser():

def main(): # pragma: no cover
# We call parse_args() again inside the app.
# We only call it here so "--help" is handled.
# We only call it here so "--help" is handled,
# and to validate inputs.
get_arg_parser().parse_args()
Copy link
Member

Choose a reason for hiding this comment

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

Can we also have a test that the required arguments were passed? When I run the app with no args, it shows a stack trace of an unhandled error. I read your comment about skipping this for now, but I'm not sure I understand how that helps with debugging?

@mccalluc
Copy link
Contributor Author

mccalluc commented Oct 8, 2024

@ekraffmiller , added assertions in the end-to-end test to make sure there are no shiny errors, and fixed the error we were seeing by just returning None if no file has been selected. Ready for re-review.

@mccalluc mccalluc requested a review from ekraffmiller October 8, 2024 16:10
Copy link
Member

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

Comments addressed, approving

dp_creator_ii/__init__.py Show resolved Hide resolved
@mccalluc mccalluc merged commit e8ecf6e into main Oct 10, 2024
2 checks passed
@mccalluc mccalluc deleted the 38-read-csv-columns branch October 10, 2024 18:46
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.

Parse uploaded CSV and return column headers
2 participants