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

[CT-3334] Remove usage of dbt.contracts.graph.nodes.ConstraintType, ColumnLevelConstraint, ModelLevelConstraint in dbt/adapters #9024

Closed
1 task done
Tracked by #8917
MichelleArk opened this issue Nov 7, 2023 · 0 comments
Assignees

Comments

@MichelleArk
Copy link
Contributor

MichelleArk commented Nov 7, 2023

Housekeeping

  • I am a maintainer of dbt-core

Short description

dbt.contracts.graph.nodes.ConstraintType is used in dbt/adapters in:

  • BaseAdapter.CONSTRAINT_SUPPORT
  • BaseAdapter.process_parsed_constraint
  • PostgresAdapter.CONSTRSAINT_SUPPORT
    for the purposes of rendering python constraints objects to DDL during materializations. ConstraintType is also used in parsing and

ColumnLevelConstraint and ModelLevelConstraint are used for similar purpose in dbt/adapters

Additionally, these classes are used in parsing and are part of the serialized manifest in core

Implementation options:

  • define these dbt.contracts.graph.nodes outside of core - either in dbt.common.contracts or dbt.adapters.contracts + update import paths
  • keep the existing node classes in core, but define separate protocols or dataclasses in adapters for passing data between core and adapters - this will involve some duplication but may be beneficial if the adapters module does not need everything functional in these classes provided by core, but just the data / schemas.

Acceptance criteria

The following adapter interfaces no longer rely on dbt.contracts.graph.nodes.ConstraintType:

  • BaseAdapter.CONSTRAINT_SUPPORT
  • BaseAdapter.process_parsed_constraint
  • PostgresAdapter.CONSTRSAINT_SUPPORT

Impact to Other Teams

1p adapter imports will need to be updated, but those can be done separately as part of a bundled migration of 1p for #8917 if the work is done on a feature branch: #8906

Will backports be required?

No

Context

No response

@github-actions github-actions bot changed the title Remove usage of dbt.contracts.graph.nodes.ConstraintType in dbt/adapters [CT-3334] Remove usage of dbt.contracts.graph.nodes.ConstraintType in dbt/adapters Nov 7, 2023
@MichelleArk MichelleArk changed the title [CT-3334] Remove usage of dbt.contracts.graph.nodes.ConstraintType in dbt/adapters [CT-3334] Remove usage of dbt.contracts.graph.nodes.ConstraintType, ColumnLevelConstraint, ModelLevelConstraint in dbt/adapters Nov 7, 2023
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

No branches or pull requests

2 participants