Skip to content

daft.functions.file#

file #

file(url: Expression, io_config: IOConfig | None = None) -> Expression

Converts a string containing a file reference to a daft.File reference.

Parameters:

Name Type Description Default
url StringExpression

the url of the file

required
io_config IOConfig, default=None

The IO configuration to use.

None

Returns:

Name Type Description
Expression File Expression

An expression containing the file reference.

Source code in daft/functions/file_.py
12
13
14
15
16
17
18
19
20
21
22
23
def file(url: Expression, io_config: IOConfig | None = None) -> Expression:
    """Converts a string containing a file reference to a `daft.File` reference.

    Args:
        url (StringExpression): the url of the file
        io_config (IOConfig, default=None): The IO configuration to use.

    Returns:
        Expression (File Expression): An expression containing the file reference.

    """
    return url._eval_expressions("file", io_config=io_config)