dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.25k stars 1.53k forks source link

Add `get_catalog_for_single_relation` to `MockAdapter` #10336

Closed aranke closed 1 week ago

aranke commented 1 week ago

Example failing logs:

        mock_mp_context = mock.MagicMock()
        adapter_class = adapter_factory()
>       return adapter_class(mock_config, mock_mp_context)
E       TypeError: Can't instantiate abstract class MockAdapter with abstract method get_catalog_for_single_relation

tests/unit/context/test_context.py:157: TypeError

---------- coverage: platform linux, python 3.11.9-final-0 -----------
Coverage XML written to file coverage.xml

=========================== short test summary info ============================
ERROR tests/unit/context/test_context.py::TestParseWrapper::test_unwrapped_method
ERROR tests/unit/context/test_context.py::TestParseWrapper::test_wrapped_method
ERROR tests/unit/context/test_context.py::TestRuntimeWrapper::test_unwrapped_method

Similar fix in dbt-snowflake: https://github.com/dbt-labs/dbt-snowflake/pull/1064/files#diff-89d74eae44795c1174908ac6de68178b1c8c27db47d7531a4533b72b42963856R36-R38

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.79%. Comparing base (0fdc83a) to head (d964e52).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #10336 +/- ## ========================================== + Coverage 86.08% 88.79% +2.70% ========================================== Files 180 180 Lines 22490 22490 ========================================== + Hits 19361 19969 +608 + Misses 3129 2521 -608 ``` | [Flag](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10336/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10336/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `86.08% <ø> (ø)` | | | [unit](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10336/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `62.19% <ø> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.