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

Fix issue where file system mount to invalid directory caused plan to fail #106

Merged
merged 5 commits into from Jun 16, 2020

Conversation

storey247
Copy link

@storey247 storey247 commented Jun 15, 2020

  • Removed redundant call to dbutils.fs.ls() when reading mounts
  • Created interface for CommandExecutor
  • Added unit tests for mount logic which use interface to allow mocking of the call to execute db command
  • Fixed minor linting issues

Essentially the dbutils.fs.ls call was causing the error to be thrown. This is because it checks that the directory exists. When reading the mounts from the db workspace we don't really care if they are actually valid mounts, just that they exist and if their configuration has changed.

Fixes issue #105

@storey247 storey247 changed the title Ds/fixmountdirectoryerror Fix issue where file system mount to invalid directory caused plan to fail Jun 15, 2020
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.

Looks good

PR feedback to verify interface
@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2020

Codecov Report

Merging #106 into master will increase coverage by 1.11%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #106      +/-   ##
==========================================
+ Coverage   47.11%   48.22%   +1.11%     
==========================================
  Files          56       56              
  Lines        7138     7135       -3     
==========================================
+ Hits         3363     3441      +78     
+ Misses       3724     3634      -90     
- Partials       51       60       +9     
Flag Coverage Δ
#client 76.45% <ø> (ø)
#provider 40.44% <33.33%> (+1.41%) ⬆️
Impacted Files Coverage Δ
client/service/commands.go 93.93% <ø> (ø)
databricks/resource_databricks_aws_s3_mount.go 33.33% <0.00%> (ø)
...ricks/resource_databricks_azure_adls_gen1_mount.go 37.33% <0.00%> (ø)
...ricks/resource_databricks_azure_adls_gen2_mount.go 37.10% <0.00%> (ø)
databricks/resource_databricks_azure_blob_mount.go 36.23% <0.00%> (ø)
databricks/mounts.go 30.29% <45.45%> (+28.48%) ⬆️

@stikkireddy stikkireddy merged commit 1ca9c22 into databricks:master Jun 16, 2020
@stikkireddy
Copy link
Contributor

LGTM now thx for the update

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.

None yet

4 participants