Aurélien Ribon
07/17/2024, 8:04 AMis_datatype_temporal
impossible to implement by comparing datatypes directly.
I did not found any simple way to get the "timestamp" information from the datatype.
How would you implement such function?
Thank you!Colin Ho
07/17/2024, 4:13 PMdaft.DataType.date()._is_temporal_type()
Colin Ho
07/17/2024, 4:16 PMtime
type is currently not categorized as a 'temporal' type, so you may have to add some custom code. (I'll look into enabling it)jay
07/17/2024, 4:44 PMDataType
Aurélien Ribon
07/17/2024, 5:30 PMjay
07/17/2024, 5:30 PMAurélien Ribon
07/17/2024, 5:33 PM'Timestamp(Milliseconds, None)'
, so I could theoretically just test for the Timestamp(
prefix in this case, and do the same for other dtypes.Aurélien Ribon
07/17/2024, 5:34 PMAurélien Ribon
07/17/2024, 5:37 PMdtype.base
would return string 'Timestamp'
, and be present in all DataType instances
• dtype.unit
would return an instance of <http://TimeUnit.ms|TimeUnit.ms>()
, and only be present in Timestamp and Time dtypes
• dtype.timezone
would do the same for timezones, in Timestamp dtypes only, etc etc.Aurélien Ribon
07/17/2024, 5:39 PM.base
property, I cannot see anything else than a string as return, as their is no class for the "base" dtypes, and creating some would be maybe overkill.
For the per-datatype properties, they would be very interesting to be able to access those details, since once the dtype is built, their is no (public) way to access this information anymore.