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 missing stat() methods to DBFSPath and WorkspacePath #144

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

ericvergnaud
Copy link
Contributor

Fixes #142 and #143

Copy link

github-actions bot commented Sep 10, 2024

❌ 38/40 passed, 2 failed, 1m30s total

❌ test_detect_global: AttributeError: 'PermissionDenied' object has no attribute 'message' (754ms)
AttributeError: 'PermissionDenied' object has no attribute 'message'
10:26 DEBUG [databricks.sdk] Loaded from environment
10:26 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
10:26 INFO [databricks.sdk] Using Databricks Metadata Service authentication
[gw1] linux -- Python 3.10.14 /home/runner/work/blueprint/blueprint/.venv/bin/python
10:26 DEBUG [databricks.sdk] Loaded from environment
10:26 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
10:26 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:26 DEBUG [databricks.labs.blueprint.installation] Uploading: /Applications/Ung4/some
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/import
> [raw stream]
< 404 Not Found
< {
<   "error_code": "RESOURCE_DOES_NOT_EXIST",
<   "message": "The parent folder (/Applications/Ung4) does not exist."
< }
10:26 DEBUG [databricks.labs.blueprint.installation] Creating missing folders: /Applications/Ung4
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/mkdirs
> {
>   "path": "/Applications/Ung4"
> }
< 403 Forbidden
< {
<   "error_code": "PERMISSION_DENIED",
<   "message": "4106dc97-a963-48f0-a079-a578238959a6 does not have View permissions on 0. Please contact the own... (34 more bytes)"
< }
10:26 DEBUG [databricks.sdk] Loaded from environment
10:26 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
10:26 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:26 DEBUG [databricks.labs.blueprint.installation] Uploading: /Applications/Ung4/some
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/import
> [raw stream]
< 404 Not Found
< {
<   "error_code": "RESOURCE_DOES_NOT_EXIST",
<   "message": "The parent folder (/Applications/Ung4) does not exist."
< }
10:26 DEBUG [databricks.labs.blueprint.installation] Creating missing folders: /Applications/Ung4
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/mkdirs
> {
>   "path": "/Applications/Ung4"
> }
< 403 Forbidden
< {
<   "error_code": "PERMISSION_DENIED",
<   "message": "4106dc97-a963-48f0-a079-a578238959a6 does not have View permissions on 0. Please contact the own... (34 more bytes)"
< }
[gw1] linux -- Python 3.10.14 /home/runner/work/blueprint/blueprint/.venv/bin/python
❌ test_existing_installations_are_detected: AttributeError: 'PermissionDenied' object has no attribute 'message' (303ms)
AttributeError: 'PermissionDenied' object has no attribute 'message'
10:26 DEBUG [databricks.sdk] Loaded from environment
10:26 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
10:26 INFO [databricks.sdk] Using Databricks Metadata Service authentication
[gw1] linux -- Python 3.10.14 /home/runner/work/blueprint/blueprint/.venv/bin/python
10:26 DEBUG [databricks.sdk] Loaded from environment
10:26 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
10:26 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:26 DEBUG [databricks.labs.blueprint.installation] Uploading: /Applications/pgob/some
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/import
> [raw stream]
< 404 Not Found
< {
<   "error_code": "RESOURCE_DOES_NOT_EXIST",
<   "message": "The parent folder (/Applications/pgob) does not exist."
< }
10:26 DEBUG [databricks.labs.blueprint.installation] Creating missing folders: /Applications/pgob
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/mkdirs
> {
>   "path": "/Applications/pgob"
> }
< 403 Forbidden
< {
<   "error_code": "PERMISSION_DENIED",
<   "message": "4106dc97-a963-48f0-a079-a578238959a6 does not have View permissions on 0. Please contact the own... (34 more bytes)"
< }
10:26 DEBUG [databricks.sdk] Loaded from environment
10:26 DEBUG [databricks.sdk] Ignoring pat auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Ignoring basic auth, because metadata-service is preferred
10:26 DEBUG [databricks.sdk] Attempting to configure auth: metadata-service
10:26 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:26 DEBUG [databricks.labs.blueprint.installation] Uploading: /Applications/pgob/some
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/import
> [raw stream]
< 404 Not Found
< {
<   "error_code": "RESOURCE_DOES_NOT_EXIST",
<   "message": "The parent folder (/Applications/pgob) does not exist."
< }
10:26 DEBUG [databricks.labs.blueprint.installation] Creating missing folders: /Applications/pgob
10:26 DEBUG [databricks.sdk] POST /api/2.0/workspace/mkdirs
> {
>   "path": "/Applications/pgob"
> }
< 403 Forbidden
< {
<   "error_code": "PERMISSION_DENIED",
<   "message": "4106dc97-a963-48f0-a079-a578238959a6 does not have View permissions on 0. Please contact the own... (34 more bytes)"
< }
[gw1] linux -- Python 3.10.14 /home/runner/work/blueprint/blueprint/.venv/bin/python

Running from acceptance #211

@ericvergnaud
Copy link
Contributor Author

@nfx the no-cheat is about avoiding pylint errors in existing code
not sure what's causing the acceptance failure. The 2 failing tests pass locally, both are marked PermissionDenied. Smells like our test infra (sandbox?) expecting a message field ?

Copy link
Collaborator

@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.

lgtm

@nfx nfx merged commit 36fc873 into main Sep 13, 2024
7 of 9 checks passed
@nfx nfx deleted the fix-missing-stat-methods branch September 13, 2024 17:11
nfx added a commit that referenced this pull request Sep 13, 2024
* add missing stat() methods to DBFSPath and WorkspacePath ([#144](#144)). The `stat()` method has been added to both `DBFSPath` and `WorkspacePath` classes, addressing issues [#142](#142) and [#143](#143). This method, which adheres to the Posix standard, returns file status in the `os.stat_result` format, providing access to various metadata attributes such as file size, last modification time, and creation time. By incorporating this method, developers can now obtain essential file information for Databricks File System (DBFS) and Databricks Workspace paths when working with these classes. The change includes a new test case for `stat()` in the `test_paths.py` file to ensure the correctness of the method for both classes.
@nfx nfx mentioned this pull request Sep 13, 2024
nfx added a commit that referenced this pull request Sep 13, 2024
* add missing stat() methods to DBFSPath and WorkspacePath
([#144](#144)). The
`stat()` method has been added to both `DBFSPath` and `WorkspacePath`
classes, addressing issues
[#142](#142) and
[#143](#143). This
method, which adheres to the Posix standard, returns file status in the
`os.stat_result` format, providing access to various metadata attributes
such as file size, last modification time, and creation time. By
incorporating this method, developers can now obtain essential file
information for Databricks File System (DBFS) and Databricks Workspace
paths when working with these classes. The change includes a new test
case for `stat()` in the `test_paths.py` file to ensure the correctness
of the method for both classes.
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.

[BUG] WorkspacePath is missing stat() method
2 participants