Skip to content

Commit a07fd18

Browse files
authored
Revert "Relax dependency constraints (#1713)" (#1754)
This reverts commit 21f7b3a.
1 parent 21f7b3a commit a07fd18

16 files changed

Lines changed: 26 additions & 74 deletions

File tree

.github/workflows/lint-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
python-version: "3.12"
5050
- name: Install linters
5151
run: |
52-
pip install black flake8
52+
pip install black flake8 -c requirements-dev.txt
5353
- name: Run flake8
5454
run: |
5555
flake8 ${{needs.get_changed_files.outputs.py}} --count --select=E9,F63,F7,F82 --show-source --statistics

.github/workflows/test-unit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
python-version: "3.12"
1717
- name: Install requirements
1818
run: |
19-
pip install -r requirements.txt
20-
pip install --group dev -e .
19+
pip install -r requirements-dev.txt
20+
pip install -e .
2121
- name: Running Tests
2222
env:
2323
CDISC_LIBRARY_API_KEY: fakekey12341234

cdisc_rules_engine/dataset_builders/contents_define_vlm_dataset_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def build(self):
6666
data_contents_with_vlm["variable_value_length"] = data_contents_with_vlm.data[
6767
["variable_value", "define_vlm_data_type"]
6868
].apply(
69-
lambda row: ValuesDatasetBuilder.calculate_variable_value_length(
69+
lambda row: self.calculate_variable_value_length(
7070
row["variable_value"], row["define_vlm_data_type"]
7171
),
7272
axis=1,

cdisc_rules_engine/models/dataset/dask_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ def __setitem__(self, key, value):
8181
array_values = da.from_array(value, chunks=tuple(chunks))
8282
self._data[key] = array_values
8383
elif isinstance(value, pd.Series):
84-
pdf = self._data.compute()
85-
pdf[key] = value.values
86-
self._data = dd.from_pandas(pdf, npartitions=1)
84+
self._data = self._data.reset_index()
85+
self._data = self._data.set_index("index")
86+
self._data[key] = value
8787
elif isinstance(value, dd.DataFrame):
8888
for column in value:
8989
self._data[column] = value[column]

cdisc_rules_engine/operations/codelist_extensible.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ def _handle_multiple_versions(self) -> pd.Series:
3232
"codelist_code": "string",
3333
}
3434
)
35-
cast_cols = {self.params.ct_version: "string"}
36-
if self.params.codelist_code in self.evaluation_dataset.columns:
37-
cast_cols[self.params.codelist_code] = "string"
38-
self.evaluation_dataset = self.evaluation_dataset.astype(cast_cols)
3935
if self.params.codelist_code in self.evaluation_dataset.columns:
4036
is_extensible = self.evaluation_dataset.merge(
4137
ct_df.data,

cdisc_rules_engine/operations/codelist_terms.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ def _handle_multiple_versions(self) -> pd.Series:
6464
"codelist_code": "string",
6565
}
6666
)
67-
cast_cols = {self.params.ct_version: "string"}
68-
if self.params.codelist_code in self.evaluation_dataset.columns:
69-
cast_cols[self.params.codelist_code] = "string"
70-
self.evaluation_dataset = self.evaluation_dataset.astype(cast_cols)
7167
if self.params.codelist_code in self.evaluation_dataset.columns:
7268
result = self.evaluation_dataset.merge(
7369
ct_df.data,

cdisc_rules_engine/services/data_readers/csv_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import tempfile
22

3-
import dask.dataframe as dd
3+
from dask.dataframe import dd
44

55
from cdisc_rules_engine.exceptions.custom_exceptions import InvalidCSVFile
66
from cdisc_rules_engine.interfaces import DataReaderInterface

cdisc_rules_engine/services/data_services/usdm_data_service.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -399,19 +399,8 @@ def __read_node_metadata(
399399
}
400400

401401
@staticmethod
402-
def __get_full_path(node: DatumInContext) -> str:
403-
parts = []
404-
current = node
405-
while current is not None and current.context is not None:
406-
parts.append(str(current.path))
407-
current = current.context
408-
result = ""
409-
for part in reversed(parts):
410-
if part.startswith("["):
411-
result += part
412-
else:
413-
result = (result + "." if result else "") + part
414-
return result
402+
def __get_full_path(node: DatumInContext):
403+
return f"{node.full_path}".replace(".[", "[")
415404

416405
def __get_datasets_content_index(self) -> List[dict]:
417406
"""

cdisc_rules_engine/services/datasetxpt_metadata_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def read(self) -> dict:
6161
"variable_labels": list(metadata.column_labels),
6262
"variable_names": list(metadata.column_names),
6363
"variable_formats": [
64-
"" if (data_type == "NULL" or data_type is None) else data_type
64+
"" if data_type == "NULL" else data_type
6565
for data_type in metadata.original_variable_types.values()
6666
],
6767
"variable_name_to_label_map": metadata.column_names_to_labels,

core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,15 @@ def load_custom_dotenv_from_data_options(_ctx, _param, value):
357357
"-s",
358358
"--standard",
359359
required=True,
360+
default=None,
360361
help="CDISC standard to validate against",
361362
envvar="PRODUCT",
362363
)
363364
@click.option(
364365
"-v",
365366
"--version",
366367
required=True,
368+
default=None,
367369
help="Standard version to validate against",
368370
envvar="VERSION",
369371
)

0 commit comments

Comments
 (0)