Fix charmap error on non-ASCII output and add warehouse ID setup step#9
Merged
Merged
Conversation
Reconfigure stdout and stderr to UTF-8 at startup via configure_text_streams(), preventing charmap codec errors when query results contain Greek, Cyrillic, emoji, or other non-ASCII characters. The subprocess call in run_query already used UTF-8; this closes the remaining gap at the print() call in main(). Add a "Set your warehouse ID" step to the asset success_message so first-time users see the databricks warehouses list lookup and DATABRICKS_WAREHOUSE_ID export pattern immediately after install, before the smoke-check step. The instruction belongs here rather than in SKILL.md, which is read by agents, not by humans during setup. Three new tests: configure_text_streams smoke test, and two format_rows tests covering non-ASCII scalar and TSV output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small improvements to the
dbx-ro-queryasset triggered by real usage:Encoding fix: query results containing non-ASCII characters (Greek, Cyrillic, emoji) caused a
charmapcodec error on Windows when printed to stdout.configure_text_streams()reconfigures both stdout and stderr to UTF-8 witherrors="replace"at startup. The subprocess call inrun_queryalready used UTF-8; this closes the remaining gap at theprint()call inmain().Install message: first-time users had no prompt to set
DATABRICKS_WAREHOUSE_IDbefore running the smoke check. A new step 2 in thesuccess_messageshows thedatabricks warehouses listlookup and the export pattern. Placed here rather than inSKILL.mdbecause SKILL.md is read by agents during task execution, not by humans during initial setup.Changes
scripts/dbx-ro-query.py: addconfigure_text_streams(), call it as first line ofmain()databricks_template_schema.json: insert warehouse ID setup step (step 2) insuccess_message, renumber smoke check to step 3tests/assets/test_dbx_ro_query.py: three new tests —configure_text_streamssmoke test, non-ASCII scalar output, non-ASCII TSV outputCHANGELOG.md: add[1.7.1] - 2026-05-13entryChange Area
assets/<name>/)Configuration Axes Affected
Testing
pytest tests/ -V)Asset Changes (if applicable)
databricks bundle init . --template-dir assets/<name> --output-dir <dir>library/helpers.tmplor other assets)Checklist