概要
Azure Databricksにて、dbutils.fs.lsのヘルプを表示する方法を記載します。
エラー時のコード
%python
dbutils.fs.ls.help()
エラーメッセージ
AttributeError: 'function' object has no attribute 'help'
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<command-3260864872878574> in <module>()
1
----> 2 dbutils.fs.ls.help()
AttributeError: 'function' object has no attribute 'help'
正常時のコード
%python
dbutils.fs.help("ls")
正常メッセージ
/**
* Lists the contents of a directory.
*
* Example: display(ls("/mnt/my-folder/"))
*
* The FileInfo object that is returned has the following helper methods:
* val files = ls("/mnt/my-folder/")
* files.map(_.name) // [myFile, myDir/]
* files.map(_.length) // [1286, 0]
* files.map(_.path) // [/mnt/my-folder/myFile, /mnt/my-folder/myDir/]
* files.map(_.isDir) // [false, true]
* files.map(_.isFile) // [true, false]
*
* @param dir FileSystem URI
* @return Ordered sequence of FileInfos containing the name and size of each file.
*/
ls(dir: java.lang.String): scala.collection.Seq
参考リンク
- Azure Databricksのリンク https://docs.azuredatabricks.net/user-guide/dev-tools/dbutils.html
- Databricksのリンク https://docs.databricks.com/user-guide/dev-tools/dbutils.html