You are viewing documentation about an older version (1.16.0). View latest version

snowflake.snowpark.files.SnowflakeFile

class snowflake.snowpark.files.SnowflakeFile(file_location: str, mode: str = 'r', is_owner_file: bool = False, *, require_scoped_url: bool = True)[source]

Bases: RawIOBase

SnowflakeFile provides an interface to operate on files as Python IOBase-like objects in UDFs and stored procedures. SnowflakeFile supports most operations supported by Python IOBase objects. A SnowflakeFile object can be used as a Python IOBase object.

The constructor of this class is not supposed to be called directly. Call open() to create a SnowflakeFile object.

This class is intended for usage within UDFs and stored procedures and many methods do not work locally.

Methods

close()

In UDF and Stored Procedures, the close func closes the IO Stream included in the SnowflakeFile.

detach()

Not yet supported in UDF and Stored Procedures.

fileno()

See https://docs.python.org/3/library/io.html#io.IOBase.fileno

flush()

Not yet supported in UDF and Stored Procedures.

isatty()

Returns false, file streams in stored procedures and UDFs are never interactive in Snowflake.

open(file_location[, mode, is_owner_file, ...])

Returns a SnowflakeFile.

read([size])

See https://docs.python.org/3/library/io.html#io.RawIOBase.read

read1([size])

See https://docs.python.org/3/library/io.html#io.BufferedIOBase.read1

readable()

See https://docs.python.org/3/library/io.html#io.IOBase.readable

readall()

See https://docs.python.org/3/library/io.html#io.RawIOBase.readall

readinto(b)

See https://docs.python.org/3/library/io.html#io.IOBase.readinto

readinto1(b)

See https://docs.python.org/3/library/io.html#io.BufferedIOBase.readinto1

readline([size])

See https://docs.python.org/3/library/io.html#io.IOBase.readline

readlines([hint])

See https://docs.python.org/3/library/io.html#io.IOBase.readlines

seek(offset[, whence])

See https://docs.python.org/3/library/io.html#io.IOBase.seek

seekable()

See https://docs.python.org/3/library/io.html#io.IOBase.seekable

tell()

See https://docs.python.org/3/library/io.html#io.IOBase.tell

truncate([size])

Not yet supported in UDF and Stored Procedures.

writable()

Not yet supported in UDF and Stored Procedures.

write(b)

Not yet supported in UDF and Stored Procedures.

writelines(lines)

Not yet supported in UDF and Stored Procedures.

Attributes