Skip to content

Commit ceee8db

Browse files
rustyconoverclaude
andcommitted
Fix AnyArrow type detection for Arg[AnyArrow] subscript syntax
The extract_argument_specs function was only checking class-level type hints (e.g., `col1: AnyArrow = Arg[AnyArrow](...)`) for AnyArrow/TableInput, but not the Arg subscript type parameter. This caused Arg[AnyArrow] without an explicit type annotation to be treated as null type instead of any type. Now checks both _type_param on the Arg and the class type hint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 941f000 commit ceee8db

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

vgi/argument_spec.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,12 @@ class MyFunction(TableInOutFunction):
337337
seen_names.add(attr_name)
338338
arg: Arg[Any] = attr_value
339339

340-
# Check type hint for special types
340+
# Check for special types (AnyArrow, TableInput)
341+
# Priority: Arg subscript type (Arg[AnyArrow]) > class type hint
341342
hint = hints.get(attr_name)
342-
is_table_input = hint is TableInput
343-
is_any_type = hint is AnyArrow
343+
type_param = getattr(arg, "_type_param", None)
344+
is_table_input = type_param is TableInput or hint is TableInput
345+
is_any_type = type_param is AnyArrow or hint is AnyArrow
344346

345347
# Determine Arrow type using priority order:
346348
# 1. Explicit arrow_type on Arg

0 commit comments

Comments
 (0)