Skip to content

Commit 6bbfecb

Browse files
committed
A few small fixes of the integratiom tests. Postpones rest
1 parent fd82d9d commit 6bbfecb

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

tests/integration/novel/cases/raw/flows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ def specialize_record_models_func_flow(
5353
tables: Dataset[GeneralTable]) -> MultiModelDataset[GeneralTable]:
5454

5555
record_models = Dataset[RecordSchema]([
56-
(table_name, extract_record_model(table)) for table_name, table in tables
56+
(table_name, extract_record_model(table)) for table_name, table in tables.items()
5757
])
5858
return apply_models_to_dataset(tables, record_models)

tests/integration/novel/cases/raw/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def merge_key_value_into_str(key: Any, val: Any) -> str:
2727
@TaskTemplate()
2828
def extract_record_model(table: GeneralTable) -> RecordSchema:
2929
record_model = {}
30-
for record in table:
30+
for record in table.to_data():
3131
for field_key, field_val in record.items():
3232
if field_key not in record_model:
3333
record_model[field_key] = type(field_val)

tests/integration/novel/helpers/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class GeneralRecord(Model[Dict[str, Union[int, str]]]):
3333
"""This is a general record"""
3434

3535

36-
class GeneralTable(TableTemplate[GeneralRecord]):
36+
class GeneralTable(Model[TableTemplate[GeneralRecord]]):
3737
"""This is a general table"""
3838

3939

tests/integration/novel/test_multi_model_dataset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import inspect
12
from inspect import Parameter
23
from types import NoneType
34
from typing import Annotated
@@ -90,15 +91,15 @@ def test_specialize_record_models_signature_and_return_type_func(
9091
runtime_all_engines: Annotated[NoneType, pytest.fixture], # noqa
9192
case: FlowCase):
9293
for flow_obj in case.flow_template, case.flow_template.apply():
93-
assert flow_obj.param_signatures == {
94+
assert inspect.signature(flow_obj).parameters == {
9495
'tables':
9596
Parameter(
9697
'tables',
9798
Parameter.POSITIONAL_OR_KEYWORD,
9899
annotation=Dataset[GeneralTable],
99100
)
100101
}
101-
assert flow_obj.return_type == MultiModelDataset[GeneralTable]
102+
assert inspect.signature(flow_obj).return_annotation == MultiModelDataset[GeneralTable]
102103

103104

104105
@pc.parametrize_with_cases('case', cases='.cases.flows', has_tag='specialize_record_models')

0 commit comments

Comments
 (0)