[Python] Im using polars library, but I'm getting 'NameError: name 'PyLazyFrame' is not...

Discussão em 'Python' iniciado por Stack, Janeiro 30, 2025.

  1. Stack

    Stack Membro Participativo

    Im trying to get data from a parquet file using SQL syntax.

    The code:

    import polars as pl

    # Ensure the variables are defined
    parquet_file = r'C:\Users\Kperez\Documents\md_curated_20250115.parquet'
    date = "2024-12-13"

    df3 = pl.read_parquet(parquet_file)

    # Register the DataFrame as a table and execute the SQL query
    ctx = pl.SQLContext()
    ctx.register("data", df3)
    result = ctx.execute(f"SELECT Identifier, IQ_CLOSEPRICE FROM data where Date = '{date}'").collect()
    print(result)


    But I got an error like this:

    NameError: name 'PyLazyFrame' is not defined

    View: [​IMG]

    Any ideas?

    Continue reading...

Compartilhe esta Página