Skip to content

Commit

Permalink
updated the pylint disabled rule for github action
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoPang committed Sep 6, 2024
1 parent ba04dd4 commit bb73f7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --disable=C0114,C0115,C0116,C0103,E0401,W1203,B101,B311
pylint $(git ls-files '*.py') --disable=C0114,C0115,C0116,C0103,E0401,W1203,B101,B311,R0913,R0914,R0915,W1202,R0801
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ repos:
rev: '1.7.7'
hooks:
- id: bandit
args: ["--skip", "B101,B311"]
args: ["--skip", "B101,B106,B107,B301,B311,B105,B608,B403"]
8 changes: 5 additions & 3 deletions src/cehrbert/utils/spark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def roll_up_procedure(procedure_occurrence, concept, concept_ancestor):
def extract_parent_code(concept_code):
return concept_code.split(".")[0]

parent_code_udf = F.udf(lambda code: extract_parent_code(code), T.StringType())
parent_code_udf = F.udf(extract_parent_code, T.StringType())

procedure_code = (
procedure_occurrence.select("procedure_source_concept_id")
Expand Down Expand Up @@ -983,14 +983,16 @@ def get_descendant_concept_ids(spark, concept_ids):
# Join the sanitized IDs into a string for the query
concept_ids_str = ",".join(map(str, sanitized_concept_ids))
# Construct and execute the SQL query using the sanitized string
descendant_concept_ids = spark.sql(f"""
descendant_concept_ids = spark.sql(
f"""
SELECT DISTINCT
c.*
FROM global_temp.concept_ancestor AS ca
JOIN global_temp.concept AS c
ON ca.descendant_concept_id = c.concept_id
WHERE ca.ancestor_concept_id IN ({concept_ids_str})
""")
"""
)
return descendant_concept_ids


Expand Down

0 comments on commit bb73f7d

Please sign in to comment.