This script could be used locally when someone wants to build models in their own schema while deferring to the Prodcution models and not having the Production manifest file stored locally.
It creates a modified manifest.yml
file based on a local one, changing the schema name from the local one to the Production one.
The target_name argument is the name of the folder where the new manifest will be created. It defaults to target2
but can be updated
Usage: python build_defer_manifest.py [--target_name TARGET_NAME] dev_schema defer_schema
After having generated the manifest, you can do a dbt run -s <my_model> --defer --state target2
Notes: