flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

fix: add support for numpy scaler types in type_engine

Open techytushar opened this issue 2 years ago • 1 comments

TL;DR

Fixes: https://github.com/flyteorg/flyte/issues/2753

Added support for numpy scaler types in the type_engine.py file

Type

  • [x] Bug Fix
  • [ ] Feature
  • [ ] Plugin

Are all requirements met?

  • [x] Code completed
  • [ ] Smoke tested
  • [ ] Unit tests added
  • [ ] Code documentation added
  • [ ] Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

  • Updated the SimpleTransformer class to take tuples of types instead of single type, so int transformer now supports both int and numpy.integer
  • Also updated the type checking methods to use isInstance instead of exact type matches

Tracking Issue

https://github.com/flyteorg/flyte/issues/2753

Follow-up issue

NA

techytushar avatar Oct 04 '22 14:10 techytushar

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

welcome[bot] avatar Oct 04 '22 14:10 welcome[bot]

@techytushar, could you fix the error and add a test?

samhita-alla avatar Oct 25 '22 13:10 samhita-alla

Accidently closed this PR, have opened a new one with added tests https://github.com/flyteorg/flytekit/pull/1258

techytushar avatar Oct 26 '22 09:10 techytushar