Skip to content

Commit

Permalink
Protext against any return type
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFarmer committed Sep 20, 2024
1 parent 2f2b458 commit 6719404
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ def _sqlalchemy(
result: Union[Sequence[sa.Row[Any]], Any] = execution_engine.execute_query(

Check warning on line 77 in great_expectations/expectations/metrics/query_metrics/query_table.py

View check run for this annotation

Codecov / codecov/patch

great_expectations/expectations/metrics/query_metrics/query_table.py#L77

Added line #L77 was not covered by tests
sa.select(sa.text(query))
).fetchmany(MAX_IN_MEMORY_RECORDS_ALLOWED)
return [element._asdict() for element in result]

if isinstance(result, (list, tuple)):
query_table_records = [element._asdict() for element in result]

Check warning on line 82 in great_expectations/expectations/metrics/query_metrics/query_table.py

View check run for this annotation

Codecov / codecov/patch

great_expectations/expectations/metrics/query_metrics/query_table.py#L81-L82

Added lines #L81 - L82 were not covered by tests
else:
query_table_records = [result]
return query_table_records

Check warning on line 85 in great_expectations/expectations/metrics/query_metrics/query_table.py

View check run for this annotation

Codecov / codecov/patch

great_expectations/expectations/metrics/query_metrics/query_table.py#L84-L85

Added lines #L84 - L85 were not covered by tests
# </snippet>

@metric_value(engine=SparkDFExecutionEngine)
Expand Down

0 comments on commit 6719404

Please sign in to comment.