Skip to content

Trying to create array of dates fails - SQL interface #18713

@HectorPascual

Description

@HectorPascual

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl

print(
    pl.sql(
        """
         select ARRAY[DATE '2024-01-01', DATE '2023-01-01']
       """
    ).collect()
)

Log output

polars.exceptions.SQLInterfaceError: expression TypedString { data_type: Date, value: "2024-01-01" } is not currently supported

Issue description

Attempting to create a simple array of dates with the SQL interface fails

Expected behavior

Would expect to get an array of dates

Installed versions

Details
--------Version info---------
Polars:              1.6.0
Index type:          UInt32
Platform:            macOS-14.5-arm64-arm-64bit
Python:              3.10.2 (main, Jul  8 2024, 10:42:19) [Clang 15.0.0 (clang-1500.3.9.4)]

----Optional dependencies----
adbc_driver_manager  <not installed>
altair               <not installed>
cloudpickle          <not installed>
connectorx           <not installed>
deltalake            0.19.1
fastexcel            <not installed>
fsspec               2024.6.1
gevent               <not installed>
great_tables         <not installed>
matplotlib           <not installed>
nest_asyncio         <not installed>
numpy                1.26.4
openpyxl             <not installed>
pandas               2.2.2
pyarrow              17.0.0
pydantic             2.9.0b2
pyiceberg            <not installed>
sqlalchemy           <not installed>
torch                <not installed>
xlsx2csv             <not installed>
xlsxwriter           <not installed>```

</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sqlArea: Polars SQL functionalityenhancementNew feature or an improvement of an existing featureneeds triageAwaiting prioritization by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions