cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Saving complete notebooks to GitHub from Databricks repos.

Serhii
Contributor

When saving notebook to GiHub repo, it is stripped to Python source code. Is it possible to save it in the ipynb formt?

1 ACCEPTED SOLUTION

Accepted Solutions

-werners-
Esteemed Contributor III

as git is a repository for source code it is logical it is converted to py files as these can be run as a job.

Is this what you look for?

https://github.com/Yoyodyne-Data-Science/ipynb-py-convert-databricks

View solution in original post

7 REPLIES 7

-werners-
Esteemed Contributor III

as git is a repository for source code it is logical it is converted to py files as these can be run as a job.

Is this what you look for?

https://github.com/Yoyodyne-Data-Science/ipynb-py-convert-databricks

Serhii
Contributor

Exactly - thanks for pointing out!

-werners-
Esteemed Contributor III

you can also use the databricks cli. There is a jupyter format option.

https://docs.microsoft.com/en-us/azure/databricks/dev-tools/cli/workspace-cli

Anonymous
Not applicable

The notesbooks save to git are in .py format. The code that is markdown or magic commands get commented out. If you reload it as a notebook, then it will render that markdown and code again. Here is what the python would look like

# Databricks notebook source
# INCLUDE_HEADER_TRUE
# INCLUDE_FOOTER_TRUE
 
# COMMAND ----------
 
# MAGIC %md 
# MAGIC # Databricks Platform
# MAGIC 

Anonymous
Not applicable

Awesome ideas and responses here in this thread @Werner Stinckens​  @Joseph Kambourakis​ ! Thanks for helping out!

@Sergii Ivakhno​ If you got what you needed, please let us know by selecting the "best answer"! This helps the community see when a question has its answer! 😊

GlennStrycker
New Contributor III

When I save+commit+push my .ipynb file to my linked git repo, I noticed that only the cell inputs are saved, not the output.  This differs from the .ipynb file I get when I choose "File / Export / iPython Notebook".  Is there a way to save the cell outputs in my git commit as well? 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.