Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin using Mergeable supplied by dbt-common #9509

Merged
merged 2 commits into from
Feb 2, 2024

Conversation

QMalcolm
Copy link
Contributor

@QMalcolm QMalcolm commented Feb 2, 2024

resolves #9505

Problem

We need to begin using Mergeable from dbt-common so that we move some objects which depend on it to dbt/artifacts

Solution

Replace Mergeable uses with Mergeable from dbt-common

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

@QMalcolm QMalcolm requested a review from a team as a code owner February 2, 2024 00:54
@cla-bot cla-bot bot added the cla:yes label Feb 2, 2024
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (db65e62) 87.97% compared to head (a36cef3) 87.97%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9509   +/-   ##
=======================================
  Coverage   87.97%   87.97%           
=======================================
  Files         167      167           
  Lines       22150    22162   +12     
=======================================
+ Hits        19486    19498   +12     
  Misses       2664     2664           
Flag Coverage Δ
integration 85.43% <100.00%> (-0.02%) ⬇️
unit 62.34% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We're currently in the process of moving the "data resource" portion on nodes
to `dbt/artifacts`. Some of those artifacts depend on `Mergeable` which has
been defined on core. In order to move the data resources to `dbt/artifacts`,
we thus need to move `Mergeable` upstream of core. We moved `Mergeable` to
[dbt-common](https://github.com/dbt-labs/dbt-common) in
dbt-labs/dbt-common#59, and released this change in
[dbt-common 0.1.3](https://pypi.org/project/dbt-common/0.1.3/). As such as, in
order to unblock some of the `dbt/artifacts` migration work, we first need to
update references to `Mergeable` in core to use the `dbt-common` definition.

NOTE: We include changing over to `Replaceable` from `dbt-common` in this
commit. This is because there wasn't a clean way to do it. If I moved the imports
of `Replaceable` on in the files where we updated `Mergeable` then we would
have left `Replaceable` in an inbetween state. If we had moved all instances
of `Replaceable`, it'd be out of scope for the change. As such, it makes more
sense to do that as a separate changeset.
@QMalcolm QMalcolm force-pushed the qmalcolm--9505-get-mergeable-from-common branch from 4133209 to a496438 Compare February 2, 2024 00:57
@MichelleArk
Copy link
Contributor

Can we safely delete Mergeable from contracts/util.py at this point as well?

Although we've removed the definition of `Mergeable` we've ensured the
import paths are still available. We do this because this is under
`contracts`, and the sudden disappearance from the import path might
cause issues for community members using dbt-core as a library.

Ideally we'd define a `Mergeable` class here that inherits the
`dbt-common` definition and raise a deprecation warning on instantiation.
However, we don't have an established strategy to do so.
@QMalcolm QMalcolm merged commit 93f1bd5 into main Feb 2, 2024
51 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--9505-get-mergeable-from-common branch February 2, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to using Mergeable from `dbt-common
2 participants