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

Improve user messaging for arrowload command #28

Merged
merged 6 commits into from
Jun 16, 2023
Merged

Conversation

rebkwok
Copy link
Contributor

@rebkwok rebkwok commented Jun 15, 2023

Makes things nicer for users by:

  1. Using the sfi module to display messages instead of print statements
  2. Outputting stata error messages and exiting with stata exit codes instead of raising python exceptions. This means that for caught exceptions, the user sees a familiar looking stata message and exit code, rather than an unexpected python traceback.
  3. Checking and exiting with stata's usual "dataset has changed" error message if we try to read an arrow file and there is data already in the stata dataset (this happens if you try to load an arrow file without clearing the stata dataset first); this should be expected behaviour for stata users. The import delimited command for importing csv files works the same way,
  4. Adds a verbosity arg so users can choose to suppress the output of the arrowload command

Users don't have any visibility into the implementation of the
arrowload command, so having it raise and output python error
messages and tracebacks are unexpected. For those errors that we
can anticipate, such as missing files and too-long variable names,
we can print a friendly error message and just exit the python script.
Also updates python print statements to use the sfi module's display
function.
@rebkwok rebkwok force-pushed the improve-user-messaging branch from 8aa34b8 to b86d32a Compare June 16, 2023 07:46
if any variables already exist in the stata dataset. This
can happen quite often, if a user tries to load another file
without clearing the dataset, or if variable have been generated
some other way. This follows the same behaviour as other commands
such as 'import delimited' so shouldn't be surprising to stata
users.
@rebkwok rebkwok force-pushed the improve-user-messaging branch 2 times, most recently from cb4f0d3 to 3ba19df Compare June 16, 2023 08:07
@rebkwok rebkwok force-pushed the improve-user-messaging branch from 3ba19df to c080713 Compare June 16, 2023 09:05
@rebkwok rebkwok force-pushed the improve-user-messaging branch from 3651149 to 06aadfb Compare June 16, 2023 13:13
@rebkwok rebkwok merged commit 0578da1 into main Jun 16, 2023
@rebkwok rebkwok deleted the improve-user-messaging branch June 16, 2023 14:45
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