-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
… alter the original dataframe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test test_upload_event_log_from_df
fails at line 92 and the following:
resp = self.api.upload_event_log_df(
'pylana-test-log-from-df', df_log, df_case, time_format='yyyy-MM-dd HH:mm:ss')
self.assertEqual(resp.status_code, 200)
which means the method upload_event_log_df
is likely broken, assumed that the test expectation hasn't changed.
pylana/utils.py
Outdated
for i in range(0, len(df.columns)): | ||
col = df.columns[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be pythonically simplified to
for i, col in enumerate(df.columns):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the case id column naming independent from the lana api convention and made the code slightly more pythonic by removing reliance on indices.
pylana/utils.py
Outdated
|
||
return df.loc[:, [c['name'] for c in dct_bare]], dct_bare | ||
dct_bare = [] | ||
ids = ["Case ID", "Action"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space character are not nice, since it prevents accessing a data frame atribute lime df.name
. Better use CaseID
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realised that the issue with the case id naming was purely a lana issue, so I introduced a mapping between a required name for the case id column in python. Thus, we can allow case id names we like, currently Case_ID
and CaseID
.
Create semantics function now only returns the semantics and does not alter the original dataframe