Skip to content

Conversation

erindru
Copy link
Collaborator

@erindru erindru commented Oct 13, 2025

the dbt cli allows a certain set of "global" options to be defined both at top level (before a subcommand) and at the subcommand level.

This means that the following are equivalent and valid:

$ dbt --profile jaffle_shop list
$ dbt list --profile jaffle_shop

This PR refactors how options are captured by the sqlmesh_dbt CLI to ensure that sqlmesh_dbt supports this too


# Enable threadumps.
faulthandler.enable()
try:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One of the tests for --debug was failing because faulthandler.enable() raises an Exception if sys.stderr.fileno() fails.

sys.stderr.fileno() can fail if something, for example the Click TestRunner (or even pytest) has messed with sys.stderr and it's no longer a file.

So rather than bomb out, I changed this to just log a warning

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.

1 participant