Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

ppratikcr7
Copy link
Collaborator

This resolves ticket #2090

Copy link
Collaborator

@VivekFitkariwala VivekFitkariwala left a 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.

@danoswaltCL
Copy link
Collaborator

@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) => {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@danoswaltCL
Copy link
Collaborator

I believe that @amurphy-cl said go ahead and put this into the release

@ppratikcr7 ppratikcr7 marked this pull request as draft November 5, 2024 11:34
@ppratikcr7
Copy link
Collaborator Author

Closing this as its handled by a new PR

@ppratikcr7 ppratikcr7 closed this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors in data export, Payload appears to copy data from Condition and duplicate rows
3 participants