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

Better error message for users trying to use abfss or s3 schemes with SDK DBUtils #634

Merged
merged 3 commits into from
May 3, 2024

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented May 1, 2024

Changes

DBUtils in the SDK only supports the dbfs and file schemes. Within DBFS, only paths in the root filesystem are supported, not mountpoints. Other schemes are not supported. To minimize customer confusion, we can check for this case during all DBUtils FS operations when constructing the path.

Tests

Added a unit test for this case.

  • make test run locally
  • make fmt applied
  • relevant integration tests applied

@mgyucht mgyucht requested a review from tanmay-db May 1, 2024 12:54
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.42%. Comparing base (a1055d1) to head (16a5aca).
Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #634      +/-   ##
==========================================
- Coverage   57.89%   52.42%   -5.47%     
==========================================
  Files          44       47       +3     
  Lines       27956    28667     +711     
==========================================
- Hits        16185    15030    -1155     
- Misses      11771    13637    +1866     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mgyucht mgyucht added this pull request to the merge queue May 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 2, 2024
@mgyucht mgyucht added this pull request to the merge queue May 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 3, 2024
@mgyucht mgyucht added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit 4769cc7 May 3, 2024
9 checks passed
@mgyucht mgyucht deleted the error-with-unsupported-dbfs-scheme branch May 3, 2024 12:32
mgyucht added a commit that referenced this pull request May 3, 2024
### New Features

* DBUtils implementation for Volumes ([#623](#623), [#634](#634), [#631](#631)).

### Bug Fixes

* Fixed codecov for repository ([#636](#636)).

API Changes:

 * Added `ingestion_definition` field for `databricks.sdk.service.pipelines.CreatePipeline`.
 * Added `ingestion_definition` field for `databricks.sdk.service.pipelines.EditPipeline`.
 * Added `ingestion_definition` field for `databricks.sdk.service.pipelines.PipelineSpec`.
 * Added `databricks.sdk.service.pipelines.IngestionConfig` dataclass.
 * Added `databricks.sdk.service.pipelines.ManagedIngestionPipelineDefinition` dataclass.
 * Added `databricks.sdk.service.pipelines.SchemaSpec` dataclass.
 * Added `databricks.sdk.service.pipelines.TableSpec` dataclass.
 * Changed `create()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service . New request type is `databricks.sdk.service.serving.CreateAppRequest` dataclass.
 * Changed `create()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service to return `databricks.sdk.service.serving.App` dataclass.
 * Removed `delete_app()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Removed `get_app()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Removed `get_app_deployment_status()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Removed `get_apps()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Removed `get_events()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `create_deployment()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `delete()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `get()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `get_deployment()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `get_environment()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `list()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `list_deployments()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `stop()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `update()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `get_open_api()` method for [w.serving_endpoints](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/serving_endpoints.html) workspace-level service.
 * Removed `databricks.sdk.service.serving.AppEvents` dataclass.
 * Removed `databricks.sdk.service.serving.AppManifest` dataclass.
 * Removed `databricks.sdk.service.serving.AppServiceStatus` dataclass.
 * Removed `databricks.sdk.service.serving.DeleteAppResponse` dataclass.
 * Removed `databricks.sdk.service.serving.DeployAppRequest` dataclass.
 * Removed `databricks.sdk.service.serving.DeploymentStatus` dataclass.
 * Removed `databricks.sdk.service.serving.DeploymentStatusState` dataclass.
 * Removed `databricks.sdk.service.serving.GetAppDeploymentStatusRequest` dataclass.
 * Removed `databricks.sdk.service.serving.GetAppResponse` dataclass.
 * Removed `databricks.sdk.service.serving.GetEventsRequest` dataclass.
 * Removed `databricks.sdk.service.serving.ListAppEventsResponse` dataclass.
 * Changed `apps` field for `databricks.sdk.service.serving.ListAppsResponse` to `databricks.sdk.service.serving.AppList` dataclass.
 * Added `databricks.sdk.service.serving.App` dataclass.
 * Added `databricks.sdk.service.serving.AppDeployment` dataclass.
 * Added `databricks.sdk.service.serving.AppDeploymentState` dataclass.
 * Added `databricks.sdk.service.serving.AppDeploymentStatus` dataclass.
 * Added `databricks.sdk.service.serving.AppEnvironment` dataclass.
 * Added `databricks.sdk.service.serving.AppState` dataclass.
 * Added `databricks.sdk.service.serving.AppStatus` dataclass.
 * Added `databricks.sdk.service.serving.CreateAppDeploymentRequest` dataclass.
 * Added `databricks.sdk.service.serving.CreateAppRequest` dataclass.
 * Added `databricks.sdk.service.serving.EnvVariable` dataclass.
 * Added `databricks.sdk.service.serving.GetAppDeploymentRequest` dataclass.
 * Added `databricks.sdk.service.serving.GetAppEnvironmentRequest` dataclass.
 * Added `databricks.sdk.service.serving.GetOpenApiRequest` dataclass.
 * Added `any` dataclass.
 * Added `databricks.sdk.service.serving.ListAppDeploymentsRequest` dataclass.
 * Added `databricks.sdk.service.serving.ListAppDeploymentsResponse` dataclass.
 * Added `databricks.sdk.service.serving.ListAppsRequest` dataclass.
 * Added `databricks.sdk.service.serving.StopAppRequest` dataclass.
 * Added `any` dataclass.
 * Added `databricks.sdk.service.serving.UpdateAppRequest` dataclass.
 * Removed [w.csp_enablement](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/csp_enablement.html) workspace-level service.
 * Removed [w.esm_enablement](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/esm_enablement.html) workspace-level service.
 * Added [w.compliance_security_profile](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/compliance_security_profile.html) workspace-level service.
 * Added [w.enhanced_security_monitoring](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/enhanced_security_monitoring.html) workspace-level service.
 * Removed `databricks.sdk.service.settings.CspEnablement` dataclass.
 * Removed `databricks.sdk.service.settings.CspEnablementSetting` dataclass.
 * Removed `databricks.sdk.service.settings.EsmEnablement` dataclass.
 * Removed `databricks.sdk.service.settings.EsmEnablementSetting` dataclass.
 * Removed `databricks.sdk.service.settings.GetCspEnablementSettingRequest` dataclass.
 * Removed `databricks.sdk.service.settings.GetEsmEnablementSettingRequest` dataclass.
 * Removed `databricks.sdk.service.settings.UpdateCspEnablementSettingRequest` dataclass.
 * Removed `databricks.sdk.service.settings.UpdateEsmEnablementSettingRequest` dataclass.
 * Added `databricks.sdk.service.settings.ComplianceSecurityProfile` dataclass.
 * Added `databricks.sdk.service.settings.ComplianceSecurityProfileSetting` dataclass.
 * Added `databricks.sdk.service.settings.EnhancedSecurityMonitoring` dataclass.
 * Added `databricks.sdk.service.settings.EnhancedSecurityMonitoringSetting` dataclass.
 * Added `databricks.sdk.service.settings.GetComplianceSecurityProfileSettingRequest` dataclass.
 * Added `databricks.sdk.service.settings.GetEnhancedSecurityMonitoringSettingRequest` dataclass.
 * Added `databricks.sdk.service.settings.UpdateComplianceSecurityProfileSettingRequest` dataclass.
 * Added `databricks.sdk.service.settings.UpdateEnhancedSecurityMonitoringSettingRequest` dataclass.
 * Added `tags` field for `databricks.sdk.service.sql.DashboardEditContent`.
 * Added `tags` field for `databricks.sdk.service.sql.QueryEditContent`.
 * Added `catalog` field for `databricks.sdk.service.sql.QueryOptions`.
 * Added `schema` field for `databricks.sdk.service.sql.QueryOptions`.
 * Added `tags` field for `databricks.sdk.service.sql.QueryPostContent`.
 * Added `query` field for `databricks.sdk.service.sql.Visualization`.

OpenAPI SHA: 9bb7950fa3390afb97abaa552934bc0a2e069de5, Date: 2024-05-02
@mgyucht mgyucht mentioned this pull request May 3, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 3, 2024
### New Features

* DBUtils implementation for Volumes
([#623](#623),
[#634](#634),
[#631](#631)). You
can now use `w.dbutils.fs` with UC volumes paths. Error handling for
non-UC, non-DBFS and non-local paths has also been improved.

### Bug Fixes

* Fixed codecov for repository
([#636](#636)).

API Changes:

* Added `ingestion_definition` field for
`databricks.sdk.service.pipelines.CreatePipeline`.
* Added `ingestion_definition` field for
`databricks.sdk.service.pipelines.EditPipeline`.
* Added `ingestion_definition` field for
`databricks.sdk.service.pipelines.PipelineSpec`.
 * Added `databricks.sdk.service.pipelines.IngestionConfig` dataclass.
* Added
`databricks.sdk.service.pipelines.ManagedIngestionPipelineDefinition`
dataclass.
 * Added `databricks.sdk.service.pipelines.SchemaSpec` dataclass.
 * Added `databricks.sdk.service.pipelines.TableSpec` dataclass.
* Changed `create()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service . New request type is
`databricks.sdk.service.serving.CreateAppRequest` dataclass.
* Changed `create()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service to return `databricks.sdk.service.serving.App`
dataclass.
* Removed `delete_app()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Removed `get_app()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Removed `get_app_deployment_status()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Removed `get_apps()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Removed `get_events()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `create_deployment()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `delete()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `get()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `get_deployment()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `get_environment()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `list()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `list_deployments()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `stop()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `update()` method for
[w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html)
workspace-level service.
* Added `get_open_api()` method for
[w.serving_endpoints](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/serving_endpoints.html)
workspace-level service.
 * Removed `databricks.sdk.service.serving.AppEvents` dataclass.
 * Removed `databricks.sdk.service.serving.AppManifest` dataclass.
 * Removed `databricks.sdk.service.serving.AppServiceStatus` dataclass.
 * Removed `databricks.sdk.service.serving.DeleteAppResponse` dataclass.
 * Removed `databricks.sdk.service.serving.DeployAppRequest` dataclass.
 * Removed `databricks.sdk.service.serving.DeploymentStatus` dataclass.
* Removed `databricks.sdk.service.serving.DeploymentStatusState`
dataclass.
* Removed `databricks.sdk.service.serving.GetAppDeploymentStatusRequest`
dataclass.
 * Removed `databricks.sdk.service.serving.GetAppResponse` dataclass.
 * Removed `databricks.sdk.service.serving.GetEventsRequest` dataclass.
* Removed `databricks.sdk.service.serving.ListAppEventsResponse`
dataclass.
* Changed `apps` field for
`databricks.sdk.service.serving.ListAppsResponse` to
`databricks.sdk.service.serving.AppList` dataclass.
 * Added `databricks.sdk.service.serving.App` dataclass.
 * Added `databricks.sdk.service.serving.AppDeployment` dataclass.
 * Added `databricks.sdk.service.serving.AppDeploymentState` dataclass.
 * Added `databricks.sdk.service.serving.AppDeploymentStatus` dataclass.
 * Added `databricks.sdk.service.serving.AppEnvironment` dataclass.
 * Added `databricks.sdk.service.serving.AppState` dataclass.
 * Added `databricks.sdk.service.serving.AppStatus` dataclass.
* Added `databricks.sdk.service.serving.CreateAppDeploymentRequest`
dataclass.
 * Added `databricks.sdk.service.serving.CreateAppRequest` dataclass.
 * Added `databricks.sdk.service.serving.EnvVariable` dataclass.
* Added `databricks.sdk.service.serving.GetAppDeploymentRequest`
dataclass.
* Added `databricks.sdk.service.serving.GetAppEnvironmentRequest`
dataclass.
 * Added `databricks.sdk.service.serving.GetOpenApiRequest` dataclass.
 * Added `any` dataclass.
* Added `databricks.sdk.service.serving.ListAppDeploymentsRequest`
dataclass.
* Added `databricks.sdk.service.serving.ListAppDeploymentsResponse`
dataclass.
 * Added `databricks.sdk.service.serving.ListAppsRequest` dataclass.
 * Added `databricks.sdk.service.serving.StopAppRequest` dataclass.
 * Added `any` dataclass.
 * Added `databricks.sdk.service.serving.UpdateAppRequest` dataclass.
* Removed
[w.csp_enablement](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/csp_enablement.html)
workspace-level service.
* Removed
[w.esm_enablement](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/esm_enablement.html)
workspace-level service.
* Added
[w.compliance_security_profile](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/compliance_security_profile.html)
workspace-level service.
* Added
[w.enhanced_security_monitoring](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/settings/enhanced_security_monitoring.html)
workspace-level service.
 * Removed `databricks.sdk.service.settings.CspEnablement` dataclass.
* Removed `databricks.sdk.service.settings.CspEnablementSetting`
dataclass.
 * Removed `databricks.sdk.service.settings.EsmEnablement` dataclass.
* Removed `databricks.sdk.service.settings.EsmEnablementSetting`
dataclass.
* Removed
`databricks.sdk.service.settings.GetCspEnablementSettingRequest`
dataclass.
* Removed
`databricks.sdk.service.settings.GetEsmEnablementSettingRequest`
dataclass.
* Removed
`databricks.sdk.service.settings.UpdateCspEnablementSettingRequest`
dataclass.
* Removed
`databricks.sdk.service.settings.UpdateEsmEnablementSettingRequest`
dataclass.
* Added `databricks.sdk.service.settings.ComplianceSecurityProfile`
dataclass.
* Added
`databricks.sdk.service.settings.ComplianceSecurityProfileSetting`
dataclass.
* Added `databricks.sdk.service.settings.EnhancedSecurityMonitoring`
dataclass.
* Added
`databricks.sdk.service.settings.EnhancedSecurityMonitoringSetting`
dataclass.
* Added
`databricks.sdk.service.settings.GetComplianceSecurityProfileSettingRequest`
dataclass.
* Added
`databricks.sdk.service.settings.GetEnhancedSecurityMonitoringSettingRequest`
dataclass.
* Added
`databricks.sdk.service.settings.UpdateComplianceSecurityProfileSettingRequest`
dataclass.
* Added
`databricks.sdk.service.settings.UpdateEnhancedSecurityMonitoringSettingRequest`
dataclass.
* Added `tags` field for
`databricks.sdk.service.sql.DashboardEditContent`.
 * Added `tags` field for `databricks.sdk.service.sql.QueryEditContent`.
 * Added `catalog` field for `databricks.sdk.service.sql.QueryOptions`.
 * Added `schema` field for `databricks.sdk.service.sql.QueryOptions`.
 * Added `tags` field for `databricks.sdk.service.sql.QueryPostContent`.
 * Added `query` field for `databricks.sdk.service.sql.Visualization`.

OpenAPI SHA: 9bb7950fa3390afb97abaa552934bc0a2e069de5, Date: 2024-05-02
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