Skip to main content

set_snowflake_mock_return_value

Changes the Snowflake mock return value of a deployment and deploys a new version.

Parameters

mb.set_snowflake_mock_return_value(deployment_name=, mock_return_value=, ...)
  • deployment_name: str The name of the deployment to get the changed mock value.
  • mock_return_value: Any The new value to use for the Snowflake mock return value. Use None to remove the mock return value.
  • branch: Optional[str] The branch of the deployment. If unspecified the current branch is used and that default is main.

Returns

No value is returned. A success message is printed if the update succeeds. And exception is raised if the deployment is not found or the branch is protected.

Examples

Setting the mock return value

Mock return values can be complex objects, like lists of dicts:

new_mock_value = [
{"key1": "value1", "key2": "value2"},
{"key1": "value1", "key2": "value2"},
]

mb.set_snowflake_mock_return_value("my_deployment", mock_return_value=new_mock_value)

Removing the mock return value from a deployment

Set the mock return value to None to remove the mock return value from the deployment:

mb.set_snowflake_mock_return_value("my_deployment", mock_return_value=None)

See also