polars.LazyFrame.write_json#

LazyFrame.write_json(file: None = None, *, to_string: bool | None = None) str[source]#
LazyFrame.write_json(file: io.IOBase | str | pathlib.Path, *, to_string: bool | None = None) None

Write the logical plan of this LazyFrame to a file or string in JSON format.

Parameters:
file

File path to which the result should be written. If set to None (default), the output is returned as a string instead.

to_string

Deprecated argument. Ignore file argument and return a string.