Skip to content

Commit 45b0cf1

Browse files
Merge pull request #61 from abhishekpnt/cbrelease-4.8.28
Issue #KB-0000: Fixing contentdf and course report
2 parents 4a65fb1 + ec80d9d commit 45b0cf1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

dfutil/content/contentDFUtil.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,12 @@ def preComputeContentWarehouseData(spark):
331331
.select(
332332
col("courseID").alias("content_id"),
333333
col("courseOrgID").alias("content_provider_id"),
334-
when(col("courseOrgName").isNotNull & trim(col("courseOrgName")) != "", col("courseOrgName")).otherwise(col("contentCreator")).alias("content_provider_name"),
334+
when(
335+
col("courseOrgName").isNotNull() &
336+
(col("courseOrgName") != "") &
337+
(col("courseOrgName") != " "),
338+
col("courseOrgName")
339+
).otherwise(col("contentCreator")).alias("content_provider_name"),
335340
col("courseName").alias("content_name"),
336341
col("category").alias("content_type"),
337342
col("batchID").alias("batch_id"),

jobs/stage-2/courseReport.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,12 @@ def process_data(self, spark,config):
334334
.select(
335335
col("courseID").alias("content_id"),
336336
col("courseOrgID").alias("content_provider_id"),
337-
when(col("courseOrgName").isNotNull & trim(col("courseOrgName")) != "", col("courseOrgName")).otherwise(col("contentCreator")).alias("content_provider_name"),
337+
when(
338+
col("courseOrgName").isNotNull() &
339+
(col("courseOrgName") != "") &
340+
(col("courseOrgName") != " "),
341+
col("courseOrgName")
342+
).otherwise(col("contentCreator")).alias("content_provider_name"),
338343
col("courseName").alias("content_name"),
339344
col("category").alias("content_type"),
340345
col("batchID").alias("batch_id"),

0 commit comments

Comments
 (0)