Skip to content

Commit

Permalink
add BaseAdapter.MAX_SCHEMA_METADATA_RELATIONS (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk authored Mar 13, 2024
1 parent 2a99e36 commit 4582932
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240312-170057.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: add BaseAdapater.MAX_SCHEMA_METADATA_RELATIONS
time: 2024-03-12T17:00:57.333545-04:00
custom:
Author: michelleark
Issue: "131"
4 changes: 3 additions & 1 deletion dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ class BaseAdapter(metaclass=AdapterMeta):
ConstraintType.foreign_key: ConstraintSupport.ENFORCED,
}

MAX_SCHEMA_METADATA_RELATIONS = 100

# This static member variable can be overriden in concrete adapter
# implementations to indicate adapter support for optional capabilities.
_capabilities = CapabilityDict({})
Expand Down Expand Up @@ -1151,7 +1153,7 @@ def get_filtered_catalog(
catalogs: agate.Table
if (
relations is None
or len(relations) > 100
or len(relations) > self.MAX_SCHEMA_METADATA_RELATIONS
or not self.supports(Capability.SchemaMetadataByRelations)
):
# Do it the traditional way. We get the full catalog.
Expand Down

0 comments on commit 4582932

Please sign in to comment.