-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix for experiment data export storing condition name in condition payload column #2092
Conversation
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.
Can you add proper types in the relevant code? This error came because in
let experiment = acc.find((e) => e.experimentId === item.experimentId);
experiment is any
let experiment
is ExperimentCSVData
and the same variable is used for the experiment.
@amurphy-cl should this go in the release? |
@@ -183,7 +183,7 @@ export class AnalyticsService { | |||
throw new HttpError(404, `Experiment not found for id: ${experimentId}`); | |||
} | |||
const formattedExperiments = experimentQueryResult.reduce((acc, item) => { |
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 type of formattedExperiments
is still any[]
. From the code, it seems that the type of formattedExperiments
is ExperimentCSVData[]
. The code of reduce is getting the unique values rather than the formatted experiment, right? So why format the data? Could you return the data after checking the unique logic?
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.
Yes, I will update the type to ExperimentCSVData[]
. So, experimentQueryResult
has the data row for each condition payload. We are getting the experiment generic data first and then we add the payload details in a separate key called details
. Later we use this formattedExperiments
to get the individual enrolment data for that experiment. So, its basically we are not checking for unique values but pushing all the condition payload details in the formattedExperiments
. The naming is nit odd, will update them.
I believe that @amurphy-cl said go ahead and put this into the release |
Closing this as its handled by a new PR |
This resolves ticket #2090