Skip to content

Commit 9503fe2

Browse files
rustyconoverclaude
andcommitted
test: Secret() on a plain mixin's on_bind() reaches the table function
Regression cover for the case vgi-amazon-sp hit on 0.51.1 (fixed by 9ffdbe7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 85c5999 commit 9503fe2

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎tests/test_secret_requirements.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,27 @@ class Meta:
270270
pass
271271

272272
assert _Child.get_metadata().required_secrets == [SecretLookupEntry(secret_type="s3", scope="s3://b/")]
273+
274+
def test_mixin_secret_reaches_subclass(self) -> None:
275+
"""A plain mixin listed before TableFunctionGenerator supplies on_bind and its Secret()."""
276+
resolve_metadata.cache_clear()
277+
278+
class _AuthMixin:
279+
@classmethod
280+
def on_bind(
281+
cls,
282+
params: BindParams[_Args],
283+
*,
284+
key: Annotated[dict[str, Any] | None, Secret("amazon_sp")] = None,
285+
) -> BindResponse:
286+
return BindResponse(output_schema=pa.schema([pa.field("x", pa.int64())]))
287+
288+
class _Scan(_AuthMixin, TableFunctionGenerator[_Args]):
289+
class Meta:
290+
pass
291+
292+
@classmethod
293+
def process(cls, params: Any, state: Any, out: Any) -> None: ...
294+
295+
assert set(_Scan._secret_params) == {"key"}
296+
assert _Scan.get_metadata().required_secrets == [SecretLookupEntry(secret_type="amazon_sp")]

0 commit comments

Comments
 (0)