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 resource_directory #690

Merged
merged 10 commits into from
Jun 22, 2021
Merged

Conversation

psg2
Copy link
Contributor

@psg2 psg2 commented Jun 18, 2021

Issue: #672

@codecov
Copy link

codecov bot commented Jun 18, 2021

Codecov Report

Merging #690 (21898d7) into master (8d4ab9a) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #690      +/-   ##
==========================================
+ Coverage   83.41%   83.49%   +0.08%     
==========================================
  Files          86       87       +1     
  Lines        7939     7979      +40     
==========================================
+ Hits         6622     6662      +40     
  Misses        839      839              
  Partials      478      478              
Impacted Files Coverage Δ
provider/provider.go 95.68% <100.00%> (+0.01%) ⬆️
workspace/resource_directory.go 100.00% <100.00%> (ø)
workspace/resource_notebook.go 87.61% <100.00%> (+0.22%) ⬆️

Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

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

Small adjustments required

workspace/resource_directory.go Outdated Show resolved Hide resolved
notebooksAPI := NewNotebooksAPI(ctx, c)
path := d.Get("path").(string)
if err := notebooksAPI.Mkdirs(path); err != nil {
// TODO: handle RESOURCE_ALREADY_EXISTS
Copy link
Contributor

Choose a reason for hiding this comment

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

For directory you probably have to remove this todo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it still needs to be handled. If we try to create the path /a/b/c but a/b is already a notebook or other type of object it will fail.

image

workspace/resource_directory.go Outdated Show resolved Hide resolved
workspace/resource_directory.go Outdated Show resolved Hide resolved
@psg2
Copy link
Contributor Author

psg2 commented Jun 18, 2021

Hi, @nfx .

Just to be sure, are you ok with the delete_recursive flag? I thought about setting this up using the AWS provider as a reference, they have a similar flag that affects the deletion behavior for databases.

image

@psg2
Copy link
Contributor Author

psg2 commented Jun 18, 2021

Will add documentation later as well.

@psg2 psg2 force-pushed the feat/add-directory-resource branch from 85b8953 to e57f60f Compare June 21, 2021 01:25
@psg2 psg2 requested a review from nfx June 21, 2021 22:40
directory_path = "/Production/ETL"
depends_on = [databricks_notebook.this]
directory_path = databricks_directory.this.path
depends_on = [databricks_directory.this]
Copy link
Contributor

Choose a reason for hiding this comment

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

Depends_on is not needed as long as there's an explicit dependency.

@nfx nfx merged commit 3f46e5e into databricks:master Jun 22, 2021
@nfx nfx linked an issue Jun 22, 2021 that may be closed by this pull request
@nfx nfx mentioned this pull request Jul 14, 2021
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.

[FEATURE] Support creation of directories on the workspace
2 participants