Skip to content

Conversation

dbp
Copy link
Collaborator

@dbp dbp commented Jun 27, 2025

Currently the error when you have the wrong number of columns listed is better than it was originally (relating to #1779), but it still makes no reference to the headers in the source itself.

In the case that we are loading from a CSV (or, google sheets?) it seems like we should show that header row when we display the error, ideally in a form that could be copied and pasted.

This is definitely a draft -- it doesn't touch the google sheet code (which I don't know where lives -- CPO?), and I'm not sure if this is the right way to retain that info, but throwing out the header row immediately makes it impossible to report a good error.

With this change, mismatches report the header columns that showed up in the CSV (if present), as well as the first data row (as an example). The c-strs aren't ideal, but I didn't want to spend time refining in case there is another approach that would be better (also, they were already there with current behavior).

Screenshot 2025-06-27 at 1 14 51 PM

@dbp dbp marked this pull request as draft June 27, 2025 17:16
@dbp dbp requested a review from jpolitz June 27, 2025 17:16
@dbp
Copy link
Collaborator Author

dbp commented Aug 1, 2025

Bump @jpolitz -- this is not necessarily critical, but would definitely help the workflow for us, since we have some activities that are:

  1. Find a dataset on X public data website
  2. Load it into Pyret
  3. Do Y with it

Step 2 will be much smoother with this.

@jpolitz jpolitz mentioned this pull request Aug 1, 2025
@jpolitz jpolitz merged commit 8949f20 into brownplt:horizon Aug 11, 2025
1 check passed
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.

2 participants