Skip to content

Restrict type hints from Any for many functions #1507

@timsaucer

Description

@timsaucer

The following comment on PR #1484. See the issue for further context.

One small nit. It probably makes sense to just land this then resolve the nit (if desired).
Follow on opportunities mostly reviewing functions (just grepped for lit), raw Any isn't great so we could potentially find a slightly narrower type:

  • in_list values: list[Expr | Any?]
  • Remove the lit in the count_star example (unrelated to changes here but in the spirit of showing we don't need lit nearly anywhere there are actually a bunch of filters that use lit that I don't think they need
  • Probably can use this approach to build out further lit coverage (CaseBuilder example as a part of functions)
  • round doc string has a for example that can probably just be pruned for the doc string example
  • make_array *args: Expr | Any
  • range Expr | float?
  • named_struct list[tuple[str, Expr | Any]]
  • array_append
  • array_has
  • array_position, index covered but element could be extended
  • array_positions
  • array_prepend
  • array_remove
  • array_remove_n
  • array_remove_all
  • array_repeat
  • array_replace
  • array_replace_n
  • array_replace_all
  • array_resize
  • gen_series
  • map_extract

Originally posted by @ntjohnson1 in #1484 (review)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions