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 update-table command to Delta Sharing CLI #568

Merged
merged 18 commits into from
Oct 25, 2022

Conversation

andyl-db
Copy link
Contributor

@andyl-db andyl-db commented Oct 17, 2022

This PR adds the following command to Delta Sharing CLI:

databricks unity-catalog shares add-table 
  --share a 
  --table b
  --shared-as "catalog.schema.table"
  --comment "comment to update to"
  --partitions '[{"values": [{"name": "a", "op": "EQUAL", "value": "1"}]}]'
  --cdf/--no-cdf
  --start-version 1

databricks unity-catalog shares add-table
  --share a 
  --table b
  --json "{...}"

databricks unity-catalog shares add-table
  --share a 
  --table b
  --json-file /path/to/json/file

databricks unity-catalog shares update-table 
  --share a 
  --table b
  --shared-as "catalog.schema.table"
  --comment "comment to update to"
  --partitions '[{"values": [{"name": "a", "op": "EQUAL", "value": "1"}]}]'
  --cdf/--no-cdf
  --start-version 1
  
databricks unity-catalog shares update-table
  --share a 
  --table b
  --json "{...}"

databricks unity-catalog shares update-table
  --share a 
  --table b
  --json-file /path/to/json/file

databricks unity-catalog shares remove-table
  --share a
  --table b

databricks unity-catalog shares remove-table
  --share a
  --shared-as "catalog.schema.table"

# On the backend, will default to using "catalog.schema.table" to remove the table
databricks unity-catalog shares remove-table
  --share a
  --table b
  --shared-as "catalog.schema.table"

databricks unity-catalog shares remove-table
  --share a 
  --json "{...}"

databricks unity-catalog shares remove-table
  --share a 
  --json-file /path/to/json/file

image

image

@andyl-db andyl-db requested a review from wchau October 17, 2022 15:47
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2022

Codecov Report

Base: 75.49% // Head: 75.72% // Increases project coverage by +0.23% 🎉

Coverage data is based on head (394b862) compared to base (c62d861).
Patch coverage: 89.41% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #568      +/-   ##
==========================================
+ Coverage   75.49%   75.72%   +0.23%     
==========================================
  Files          55       55              
  Lines        4823     4906      +83     
==========================================
+ Hits         3641     3715      +74     
- Misses       1182     1191       +9     
Impacted Files Coverage Δ
databricks_cli/unity_catalog/delta_sharing_cli.py 85.21% <89.41%> (+1.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

databricks_cli/unity_catalog/delta_sharing_cli.py Outdated Show resolved Hide resolved
databricks_cli/unity_catalog/delta_sharing_cli.py Outdated Show resolved Hide resolved
databricks_cli/unity_catalog/utils.py Outdated Show resolved Hide resolved
tests/unity_catalog/test_delta_sharing_cli.py Outdated Show resolved Hide resolved
databricks_cli/unity_catalog/utils.py Outdated Show resolved Hide resolved
@andyl-db andyl-db requested a review from wchau October 19, 2022 18:07
@andyl-db andyl-db requested a review from wchau October 20, 2022 01:06
Copy link
Contributor

@wchau wchau left a comment

Choose a reason for hiding this comment

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

databricks_cli/unity_catalog/delta_sharing_cli.py Outdated Show resolved Hide resolved
databricks_cli/unity_catalog/delta_sharing_cli.py Outdated Show resolved Hide resolved
@wchau wchau requested a review from pietern October 20, 2022 06:56
@andyl-db andyl-db force-pushed the SC-113228 branch 3 times, most recently from 063548f to 7bde91e Compare October 20, 2022 07:37
@wchau
Copy link
Contributor

wchau commented Oct 20, 2022

How about start version for CDF?

@andyl-db
Copy link
Contributor Author

How about start version for CDF?

Added it! Asked Lin and he was good with adding it!

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.

LGTM, bar a tiny comment.

Ready to go otherwise.

@pietern pietern merged commit 682fd3c into databricks:main Oct 25, 2022
@andyl-db andyl-db deleted the SC-113228 branch November 1, 2022 23:28
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.

4 participants