Fokko opened a new issue, #8282:
URL: https://github.com/apache/iceberg/issues/8282
### Feature Request / Improvement
The `date`, `datetime` and `time` is currently not supported as literal
value:
```
>>> from datetime import date
>>> literal(date(2023, 1, 1))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Users/fokkodriesprong/Desktop/iceberg/python/pyiceberg/expressions/literals.py",
line 148, in literal
raise TypeError(f"Invalid literal value: {repr(value)}")
TypeError: Invalid literal value: datetime.date(2023, 1, 1)
```
We need to accept those as literal:
- **datetime** If there is a timezone, we want to convert it to a
timestamptz. We can convert the datetime to an integer using
`datetime_to_millis` in `datetime.py`.
- **time** We can convert this into an integer using `time_to_micros` from
`datetime.py`
- **date** We can convert this into an integer using `date_to_days` from
`datetime.py`
And include tests that hit the newly created branches in the if.
### Query engine
None
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]