Skip to content

Commit

Permalink
Merge pull request #14 from shikshalokam/main
Browse files Browse the repository at this point in the history
Add ECM Field
  • Loading branch information
vijiurs authored Jun 1, 2021
2 parents 685535f + a8af44f commit 1233fb7
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions observations/pyspark_observation_status_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,20 @@ def convert_to_row(d: dict) -> Row:
"appInformation": {"appName": 1},
"isAPrivateProgram": 1,
"isRubricDriven":1,
"criteriaLevelReport":1
"criteriaLevelReport":1,
"ecm_marked_na": {
"$reduce": {
"input": "$evidencesStatus",
"initialValue": "",
"in": {
"$cond": [
{"$eq": [{"$toBool":"$$this.notApplicable"},True]},
{"$concat" : ["$$value", "$$this.name", ";"]},
"$$value"
]
}
}
}
}
}]
)
Expand Down Expand Up @@ -152,7 +165,8 @@ def convert_to_row(d: dict) -> Row:
StructType([StructField('appName', StringType(), True)])
),
StructField('isRubricDriven',StringType(),True),
StructField('criteriaLevelReport',StringType(),True)
StructField('criteriaLevelReport',StringType(),True),
StructField('ecm_marked_na', StringType(), True)
]
)

Expand Down Expand Up @@ -246,7 +260,8 @@ def convert_to_row(d: dict) -> Row:
obs_sub_df1["programExternalId"].alias("program_externalId"),
obs_sub_df1["app_name"],
obs_sub_df1["private_program"],
obs_sub_df1["solution_type"]
obs_sub_df1["solution_type"],
obs_sub_df1["ecm_marked_na"]
)
obs_sub_cursorMongo.close()

Expand Down

0 comments on commit 1233fb7

Please sign in to comment.