Databricks Machine Learning Associate Question 24
Single answerYou are working on a Databricks notebook to develop a machine learning pipeline. Your organization uses Git for version control, and you want to create a new branch to implement a feature without affecting the main branch. After creating the branch, you need to commit your changes and push them to the remote Git repository. Which sequence of steps should you follow to achieve this?
- A
Create a new branch in your Git provider, switch to that branch in the Databricks Repos interface, make changes to your notebook, commit the changes, and push to the remote repository.
- B
Make changes to your notebook in the main branch, create a new branch in Databricks Repos, commit the changes to the new branch, and push to the remote repository.
- C
Create a new branch in Databricks Repos, make changes to your notebook, commit the changes, and push to the remote repository.
- D
Create a new branch in the Databricks workspace, make changes to your notebook, and rely on Databricks autosave to sync the changes to the remote repository.
Show answer and explanation
Correct answer: A
Explanation
When working with Databricks Repos integrated with an external Git provider, it is critical to follow proper Git workflows. The best practice is to create and manage branches in the Git provider to ensure consistency and collaboration. After creating the branch, switch to it in Databricks Repos, make changes, commit them locally, and push them to the remote repository to maintain version control.
- A. Correct.
Correct. This sequence follows best practices for Git version control: creating the branch in the Git provider, switching to it in Databricks Repos, making changes, and committing/pushing them to the remote repository.
- B. Incorrect.
Incorrect. Making changes in the main branch before creating a new branch can lead to conflicts and is not aligned with Git best practices for feature development.
- C. Incorrect.
Incorrect. While creating a branch in Databricks Repos is possible, it is recommended to use the Git provider for branch creation to ensure consistency across all team members.
- D. Incorrect.
Incorrect. There is no concept of creating a branch directly in the Databricks workspace. Additionally, relying on autosave does not ensure proper version control or pushing changes to the remote repository.