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

Bug: workspace export with direct-download still tries to interpret the response as JSON #525

Closed
gerashegalov opened this issue Jun 23, 2023 · 1 comment

Comments

@gerashegalov
Copy link

Export a file with # such as an init script in bash

databricks workspace export '/Users/user@email/init.sh' --direct-download
Error: invalid character '#'

workaround:

databricks workspace export '/Users/user@email/init.sh' | jq -r .content | base64 -d
@pietern
Copy link
Contributor

pietern commented Jun 27, 2023

Thanks for reporting this issue. The direct download option has been removed from the SDK in a newer release because it's the only API that switches the response content type depending on the request payload. To make it easier to use I added a change that automatically decodes the base64 payload and prints it to stdout, so you don't need to use the workaround.

pietern added a commit that referenced this issue Jun 27, 2023
## Changes

Also see #525.

The direct download flag has been removed in newer versions because of
the content type issue.

Instead, we can make the command decode the base64 output when the
output mode is text.

```
$ databricks workspace export /some/path/script.sh
#!/bin/bash
echo "this is a script"
```

## Tests

New integration test.
@pietern pietern closed this as completed Jun 27, 2023
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

No branches or pull requests

2 participants