Skip to content

Commit

Permalink
Small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frankcorneliusmartin committed Jul 26, 2023
1 parent 364d43d commit de1fab7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 10 additions & 4 deletions feature-extraction/ohdsi/feature_extraction/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import json

from rpy2 import robjects
from rpy2.robjects.methods import RS4
Expand Down Expand Up @@ -788,10 +789,11 @@ def create_analysis_details(
... included_covariate_ids = []
... )
"""
parameters_json = json.dumps(parameters)
return extractor_r.createAnalysisDetails(
analysis_id,
sql_file_name,
parameters,
parameters_json,
included_covariate_concept_ids,
add_descendants_to_include,
excluded_covariate_concept_ids,
Expand Down Expand Up @@ -940,7 +942,7 @@ def create_detailed_temporal_covariate_settings(
class DefaultTemporalCovariateSettings:

@staticmethod
def createTemporalCovariateSettings(
def create_temporal_covariate_settings(
use_demographics_gender: bool = False,
use_demographics_age: bool = False,
use_demographics_age_group: bool = False,
Expand Down Expand Up @@ -1154,6 +1156,10 @@ def createTemporalCovariateSettings(
... use_demographics_age=True,
... )
"""

temporal_start_days_list = list(temporal_start_days)
temporal_end_days_list = list(temporal_end_days)

return extractor_r.createTemporalCovariateSettings(
use_demographics_gender,
use_demographics_age,
Expand Down Expand Up @@ -1196,8 +1202,8 @@ def createTemporalCovariateSettings(
use_distinct_observation_count,
use_visit_count,
use_visit_concept_count,
temporal_start_days,
temporal_end_days,
temporal_start_days_list,
temporal_end_days_list,
included_covariate_concept_ids,
add_descendants_to_include,
excluded_covariate_concept_ids,
Expand Down
9 changes: 5 additions & 4 deletions sqlrender/ohdsi/sqlrender/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def render(sql: str, warn_on_missing_parameters: bool = True, **kwargs) \

@staticmethod
def translate(sql: str, target_dialect: str,
temp_emulation_schema: str | None) -> StrVector:
temp_emulation_schema: str | None = None) -> StrVector:
"""
``translate`` translates SQL from one dialect to another.
Expand Down Expand Up @@ -131,7 +131,7 @@ def translate(sql: str, target_dialect: str,

@staticmethod
def translate_single_statement(
sql: str, target_dialect: str, temp_emulation_schema: str | None
sql: str, target_dialect: str, temp_emulation_schema: str | None = None
) -> StrVector:
"""
Translates a single SQL statement from one dialect to another.
Expand Down Expand Up @@ -294,7 +294,7 @@ def render_sql_file(
@staticmethod
def translate_sql_file(source_file: str | Path, target_file: str | Path,
target_dialect: str,
temp_emulation_schema: str | None) -> None:
temp_emulation_schema: str | None = None) -> None:
"""
Translate a SQL file.
Expand Down Expand Up @@ -334,7 +334,8 @@ def translate_sql_file(source_file: str | Path, target_file: str | Path,

@staticmethod
def load_render_translate_sql(sql_file: str | Path, package_name: str,
dbms: str, temp_emulation_schema: str | None,
dbms: str,
temp_emulation_schema: str | None = None,
warn_on_missing_parameters: bool = True) \
-> StrVector:
"""
Expand Down

0 comments on commit de1fab7

Please sign in to comment.