Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2021 12:33 AM
Hi @Bertrand BURCKER I tried your code and ended up with a different error. To create a directory you can try the below code and it will help create the folder for you.
import requests
from pyspark.sql.types import (StructField, StringType, StructType, IntegerType)
API_URL = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiUrl().getOrElse(None)
TOKEN = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiToken().getOrElse(None)
response = requests.post(
API_URL + '/api/2.0/workspace/mkdirs',
headers={"Authorization": "Bearer " + TOKEN},
json={"path": "/Users/prabakarxxxxxxxx/Test_dir1/"}
)