text-generation-inference icon indicating copy to clipboard operation
text-generation-inference copied to clipboard

Fix typing error due to Optional

Open Atry opened this issue 2 years ago • 3 comments
trafficstars

Optional is not a valid type because it needs type parameter

What does this PR do?

Fix typing error due to Optional

Before submitting

  • [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • [x] Did you read the contributor guideline, Pull Request section?
  • [ ] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
  • [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • [ ] Did you write any new necessary tests?

Who can review?

@OlivierDehaene OR @Narsil

Atry avatar May 18 '23 14:05 Atry

Where are these errors coming from? Is it your ide flagging it? Or mypy? In my opinion it correctly hints at what past key values is

OlivierDehaene avatar May 18 '23 15:05 OlivierDehaene

Oh, I am using Pylance, which seems stricter than mypy

Atry avatar May 18 '23 17:05 Atry

The error message is

Expected one type argument after "Optional"

Atry avatar May 18 '23 17:05 Atry