Sharing and Collaborating on Notebooks
Deslize para mostrar o menu
Collaboration is a core pillar of the Databricks Workspace. It allows multiple users to work on the same notebook simultaneously, leave comments, and manage version history, similar to how Google Docs works for text documents.
Databricks was built to break down silos between team members. In this chapter, you will explore how to share your notebooks with colleagues and use the built-in communication tools to work together more effectively.
The Share Button
In the top-right corner of any notebook, you will see a "Share" button. This is where you manage access permissions. You can share a notebook with individual users or entire groups. There are several levels of access you can grant:
- Can View: the user can see the code and results but cannot change anything;
- Can Run: the user can attach the notebook to a cluster and execute cells but cannot edit the code;
- Can Edit: the user has full permissions to change the code and documentation;
- Can Manage: the user can also change the sharing permissions for others.
Real-Time Co-Authoring
When multiple people have the notebook open, you will see their profile icons appear in the top-right header. Databricks supports real-time co-authoring, meaning you can see your teammate's cursor as they type in a cell. This eliminates the need to export and email files back and forth, ensuring everyone is always working on the "Single Source of Truth."
Using Comments for Feedback
Instead of explaining your code changes in a separate chat app, you can leave comments directly inside the notebook:
- To add a comment, highlight a piece of code or text and click the "Comment" icon that appears in the margin;
- Teammates can reply to your comments, and once a discussion is finished, you can click "Resolve" to hide the thread. This keeps the workspace clean while preserving the history of the conversation.
Revision History
Every time you make a change, Databricks automatically tracks it. By clicking the "Revision History" link (found at the top right, usually under the "Last saved" text), you can see a list of previous versions:
- Compare Versions: you can see exactly what code was added or deleted between two points in time;
- Restore: if you or a teammate accidentally delete a complex block of code, you can restore the notebook to a previous version with one click.
Exporting Notebooks
While working inside the platform is best, sometimes you need to share your work with someone outside of the Databricks environment. Under the File menu, you can choose to Export your notebook:
- DBC Archive: best for moving notebooks to another Databricks workspace;
- Source File: exports as a standard
.pyor.sqlfile; - HTML/PDF: best for sharing a static report with stakeholders who don't need to run the code.
1. Which permission level should you give a teammate if you want them to be able to see your code but NOT change it?
2. What is the benefit of the "Revision History" feature?
Obrigado pelo seu feedback!
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo