--- /dev/null
+.. change::
+ :tags: bug, schema
+ :tickets: 8102
+
+ The warnings that are emitted regarding reflection of indexes or unique
+ constraints, when the :paramref:`.Table.include_columns` parameter is used
+ to exclude columns that are then found to be part of those constraints,
+ have been removed. When the :paramref:`.Table.include_columns` parameter is
+ used it should be expected that the resulting :class:`.Table` construct
+ will not include constraints that rely upon omitted columns. This change
+ was made in response to :ticket:`8100` which repaired
+ :paramref:`.Table.include_columns` in conjunction with foreign key
+ constraints that rely upon omitted columns, where the use case became
+ clear that omitting such constraints should be expected.
duplicates = index_d.get("duplicates_constraint")
if include_columns and not set(columns).issubset(include_columns):
- util.warn(
- "Omitting %s key for (%s), key covers omitted columns."
- % (flavor, ", ".join(columns))
- )
continue
if duplicates:
continue
columns = const_d["column_names"]
duplicates = const_d.get("duplicates_index")
if include_columns and not set(columns).issubset(include_columns):
- util.warn(
- "Omitting unique constraint key for (%s), "
- "key covers omitted columns." % ", ".join(columns)
- )
continue
if duplicates:
continue
1,
)
- @testing.emits_warning(r".*omitted columns")
def test_include_columns_indexes(self, connection, metadata):
m = metadata
for c in ("a", "c", "d"):
assert c not in foo.c
- @testing.emits_warning
@testing.combinations(True, False, argnames="resolve_fks")
def test_include_cols_skip_fk_col(
self, connection, tab_w_fks, resolve_fks