Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for a job writing to a Unity Catalog volume #51

Merged
merged 13 commits into from
Dec 20, 2024

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Dec 5, 2024

This example demonstrates how a job can write a file to a Unity Catalog volume.

@@ -0,0 +1,60 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should render fine in the Github repo files. For example: https://github.com/databricks/cli/blob/main/internal/testdata/notebooks/py1.ipynb

@pietern pietern changed the title Add example for a job writing to a UC Volume Add example for a job writing to a Unity Catalog olume Dec 6, 2024
@pietern pietern changed the title Add example for a job writing to a Unity Catalog olume Add example for a job writing to a Unity Catalog volume Dec 6, 2024
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

knowledge_base/save_job_result_to_volume/databricks.yml Outdated Show resolved Hide resolved
name: my_volume
# We use the ${resources.schemas...} interpolation syntax to force the creation
# of the schema before the volume. Usage of the ${resources.schemas...} syntax
# allows Databricks Asset Bundles to form a dependency graph between resources.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to go into this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have had multiple SAs reach out to us and ask how to sequence the resource creation. Given that folks will often use schemas with their volumes it feels relevant to keep this bit here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Linking the warning PR for posterity: databricks/cli#1989

"metadata": {},
"outputs": [],
"source": [
"file_path = dbutils.widgets.get(\"file_path\")\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually work does it? Without a dbutils.widgets.text() and/or widgets section in the ipynb JSON below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine:

Screenshot 2024-12-09 at 10 18 18 PM
(.venv) ➜  cli git:(detect/schema-dep) databricks fs cat dbfs:/Volumes/main/shreyas_goenka_hello_world/my_volume/hello_world.txt -p dogfood
Hello World!%

@shreyas-goenka shreyas-goenka merged commit 1794a58 into main Dec 20, 2024
@shreyas-goenka shreyas-goenka deleted the volume/eg branch December 20, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants