databricks-sql-cli
databricks-sql-cli copied to clipboard
Support for staging_allowed_local_path
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
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