Skip to content

Conversation

@vchan
Copy link
Contributor

@vchan vchan commented Feb 20, 2023

Per the discussion with @izeigerman, the current stack trace included with model test failures is not very useful.

Old failure:

F
======================================================================
FAIL: test_example_full_model (/Users/izeigerman/github/tmp/tests/test_example_full_model.yaml:1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/izeigerman/github/sqlmesh/sqlmesh/core/test.py", line 158, in runTest
    self.assert_equal(expected_df, actual_df)
  File "/Users/izeigerman/github/sqlmesh/sqlmesh/core/test.py", line 135, in assert_equal
    raise e
  File "/Users/izeigerman/github/sqlmesh/sqlmesh/core/test.py", line 124, in assert_equal
    pd.testing.assert_frame_equal(
  File "/Users/izeigerman/github/sqlmesh/.venv/lib/python3.9/site-packages/pandas/_testing/asserters.py", line 1343, in assert_frame_equal
    assert_series_equal(
  File "/Users/izeigerman/github/sqlmesh/.venv/lib/python3.9/site-packages/pandas/_testing/asserters.py", line 1108, in assert_series_equal
    _testing.assert_almost_equal(
  File "pandas/_libs/testing.pyx", line 52, in pandas._libs.testing.assert_almost_equal
  File "pandas/_libs/testing.pyx", line 167, in pandas._libs.testing.assert_almost_equal
  File "/Users/izeigerman/github/sqlmesh/.venv/lib/python3.9/site-packages/pandas/_testing/asserters.py", line 679, in raise_assert_detail
    raise AssertionError(msg)
AssertionError: Data differs
- {'item_id': 1, 'num_orders': 3}
?                              ^

+ {'item_id': 1, 'num_orders': 2}
?                              ^

New failure:

F
======================================================================
FAIL: test_example_full_model (/Users/izeigerman/github/tmp/tests/test_example_full_model.yaml:1)
----------------------------------------------------------------------
AssertionError: Data differs
- {'item_id': 1, 'num_orders': 3}
?                              ^

+ {'item_id': 1, 'num_orders': 2}
?                              ^

@vchan vchan requested a review from SQLMesh February 20, 2023 22:26
@vchan vchan force-pushed the vchan/suppress-test-tb branch from bf4cf40 to f41ee16 Compare February 20, 2023 22:30
self,
test: unittest.TestCase,
err: t.Union[
t.Tuple[t.Type[BaseException], BaseException, types.TracebackType],
Copy link
Member

@izeigerman izeigerman Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should each tuple member be t.Optional instead of a tuple of Nones? Otherwise this signature claims that either all items must be present or none of them. If this is the expectation, then please ignore my comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the expectation. This signature matches the parent function's signature.

@izeigerman izeigerman merged commit 692d160 into main Feb 20, 2023
@izeigerman izeigerman deleted the vchan/suppress-test-tb branch February 20, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants