Skip to content

Support for staging_allowed_local_path #64

Open

Description

@jkoppelm

In order to upload a local file to a Volume (via PUT) and access the associated data (via read_files), it is necessary to pass set staging_allowed_local_path when initiating sql.connect()

https://docs.databricks.com/en/dev-tools/python-sql-connector.html

Activity

  1. jkoppelm commented on Dec 25, 2024

    @jkoppelm
    Author

    As I test, I updated sqlexecute.py to hardcode a path on my local (windows) machine:

            conn = dbsql.connect(
                server_hostname=self.hostname,
                http_path=self.http_path,
                access_token=self.access_token,
                schema=database,
                _user_agent_entry=USER_AGENT_STRING,
                staging_allowed_local_path = 'c:\\',
                **oauth_params,
            )
    

    This allowed me to successfully PUT files (and LIST them) where previously I saw the error:

    You must provide at least one staging_allowed_local_path when initialising a connection to perform ingestion commands
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions