pulumi / pulumi-databricks

Apache License 2.0
15 stars 8 forks source link

Volume file uploads remove `+` #589

Open sebbegg opened 2 months ago

sebbegg commented 2 months ago

Describe what happened

When creating a File with a + in its destination name the + is removed and replaced with a whitespace.

We're using git-based versioning for our jars/wheels which then end up looking e.g. like some-lib-1.2.3.dev1+gf4a65aec.jar. Uploading these leads to the file on databricks having the + replaced with a whitespace.

The File.path output still contains the + though, so the omission certainly doesn't seem intended.

Uploading files containing a + seems to be a valid/supported thing - it's possible e.g. via the databricks UI, so it doesn't seem to be a limitation.

Sample program

"""A Python Pulumi program"""
import base64
import secrets

from pulumi_databricks import File, FileArgs

content = secrets.token_hex(100)

File(
    "dummy-file",
    FileArgs(
        content_base64=base64.standard_b64encode(content.encode("utf-8")).decode("utf-8"),
        path="/Volumes/some/path/dummy-file-dev1+gf4a65aec.txt",
    ),
)

In the catalog UI this shows up as:

Image

Log output

No response

Affected Resource(s)

pulumi_databricks.File

Output of pulumi about

❯ pulumi about
CLI
Version      3.116.1
Go Version   go1.22.3
Go Compiler  gc

Plugins
KIND      NAME          VERSION
resource  azure-native  2.40.0
resource  databricks    1.49.0
language  python        unknown
resource  random        4.7.0
resource  traefik_crds  4.13.1

Host
OS       darwin
Version  14.6.1
Arch     x86_64

This project is written in python: executable='/Users/xyz/Projekte/faplytics-deploy/venv/bin/python3' version='3.11.9'

Current Stack: unity-filename-test

TYPE                         URN
pulumi:pulumi:Stack          urn:pulumi:unity-filename-test::unity-filename-test::pulumi:pulumi:Stack::unity-filename-test-unity-filename-test
pulumi:providers:databricks  urn:pulumi:unity-filename-test::unity-filename-test::pulumi:providers:databricks::default_1_49_0
databricks:index/file:File   urn:pulumi:unity-filename-test::unity-filename-test::databricks:index/file:File::dummy-file

Found no pending operations associated with unity-filename-test

Backend
URL            azblob://<mine>
User           me
Organizations
Token type     personal

Dependencies:
NAME                  VERSION
chardet               4.0.0
databricks-sdk        0.20.0
pip                   24.1.2
pulumi_azure_native   2.40.0
pulumi_traefik_crds   4.13.1
setuptools            70.3.0

Pulumi locates its logs in /var/folders/9r/s7hj72y57dxdjgz8rm0jd9wx734y24/T/ by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

VenelinMartinov commented 2 months ago

Hey @sebbegg, thanks for reporting and sorry you've hit this. The pulumi-databricks provider uses the terraform-databricks provider under the hood: https://github.com/databricks/terraform-provider-databricks

Looking at the issue you've reported, it seems quite likely to be an issue with the terraform provider which we've inherited - could I kindly ask you to try to reproduce this in terraform and report in the TF provider? I'm having some issues with our databricks account right now and can't get the example working.

sebbegg commented 2 months ago

Seems it's an upstream issue, just created: https://github.com/databricks/terraform-provider-databricks/issues/4039