OptionalEventTime
Raphtory’s optional EventTime type. Instances of OptionalEventTime may contain an EventTime, or be empty. This is used for functions that may not return data (such as earliest_time and latest_time) because the data is unavailable.
If data is contained, OptionalEventTime instances can be used similarly to EventTime. If empty, time operations (such as .t, .dt, .event_id) will return None. An empty OptionalEventTime is considered smaller than (<) any EventTime or OptionalEventTime with data.
Methods
| Method | Description |
|---|---|
get_event_time | Returns the contained EventTime if it exists, or else None. |
is_none | Returns true if the OptionalEventTime doesn't contain an EventTime. |
is_some | Returns true if the OptionalEventTime contains an EventTime. |
Properties
| Property | Description |
|---|---|
as_tuple | Return this entry as a tuple of (timestamp, event_id), where the timestamp is in milliseconds if an EventTime is contained, or else None. |
dt | Returns the UTC datetime representation of this EventTime's timestamp if an EventTime is contained, or else None. |
event_id | Returns the event id used to order events within the same timestamp if an EventTime is contained, or else None. |
t | Returns the timestamp in milliseconds since the Unix epoch if an EventTime is contained, or else None. |
Method Details
get_event_time
Returns the contained EventTime if it exists, or else None.
is_none
Returns true if the OptionalEventTime doesn't contain an EventTime.
Returns
| Type | Description |
|---|---|
| bool |
is_some
Returns true if the OptionalEventTime contains an EventTime.
Returns
| Type | Description |
|---|---|
| bool |
Property Details
as_tuple
Return this entry as a tuple of (timestamp, event_id), where the timestamp is in milliseconds if an EventTime is contained, or else None.
dt
Returns the UTC datetime representation of this EventTime's timestamp if an EventTime is contained, or else None.
event_id
Returns the event id used to order events within the same timestamp if an EventTime is contained, or else None.
t
Returns the timestamp in milliseconds since the Unix epoch if an EventTime is contained, or else None.