I am currently trying to do some operations on various Rayforce tables, including a 'count' aggregation. Sometimes the table whose rows I am trying to count, can end up being empty, and this seems to cause a crash. When the table is not empty things work as expected.
# Create vectors to aggregate over
dates1 = [datetime(2001, 1, 1, 1, 1, 1),
datetime(2001, 1, 1, 1, 1, 1),
datetime(2002, 2, 2, 2, 2, 2),
datetime(2002, 2, 2, 2, 2, 2)]
dates2 = [datetime(2003, 3, 3, 3, 3, 3),
datetime(2003, 3, 3, 3, 3, 3),
datetime(2003, 3, 3, 3, 3, 3),
datetime(2004, 4, 4, 4, 4, 4)]
first_date = Vector(dates1, ray_type=Timestamp)
last_date = Vector(dates2, ray_type=Timestamp)
my_table = Table({'first': first_date, 'last': last_date})
my_table = my_table.select('*').where(Column('first') > datetime(2005, 5, 5)) # Now the table is empty
counts = my_table.select(count=Column('last').count()).by('first', 'last').execute() # Causes crash
It would be nice if it could simply return another empty table or raise an error message instead.
Description
I am currently trying to do some operations on various Rayforce tables, including a 'count' aggregation. Sometimes the table whose rows I am trying to count, can end up being empty, and this seems to cause a crash. When the table is not empty things work as expected.
Sample Data
--
Version
0.6.2
Code Snippet
Output
When running the code snippet in my Jupyter notebook I get this output:
The only info in the Jupyter log is the following line:
[error] Disposing session as kernel process died ExitCode: undefined, Reason:
When running it from my terminal I get this output:
It would be nice if it could simply return another empty table or raise an error message instead.