https://flyte.org logo
#announcements
Title
# announcements
e

Eric Hsiao

07/18/2022, 5:31 PM
Hi all! I'm running into an issue where I'm trying to pass in a boolean value to a workflow. I'm on flytekit 1.1.0 and trying to run this command:
Copy code
pyflyte run my_task.py download --remote # this works
pyflyte run my_task.py download # this does not work (remote=False)
Here's an example of my workflow definition
Copy code
@workflow
def download(remote: bool = False):
    ...
And here's the error I'm getting
Copy code
line 191, in to_python_value
    raise TypeTransformerFailedError(f"Cannot convert literal {lv} to {self._type}")
flytekit.core.type_engine.TypeTransformerFailedError: Cannot convert literal scalar {
  primitive {
  }
}
 to <class 'bool'>
Is there anything obvious that I'm doing wrong?
y

Yee

07/18/2022, 5:43 PM
what is the remote flag here supposed to do btw?
and can you try with
--remote false
e

Eric Hsiao

07/18/2022, 5:52 PM
It's just a custom parameter that I'm using in my task to download locally or pass to a dedicated s3 bucket
tried
--remote false
and
--remote=false
but had the same issue
y

Yee

07/18/2022, 5:52 PM
hmm
having trouble reproing this
still working on a gist one sec
running this (just locally) and it seems to work for me
e

Eric Hsiao

07/18/2022, 7:22 PM
were you able to run that using the CLI? I wonder if that's where things break down. Something like this
Copy code
pyflyte run my_wf --remote
e

Eduardo Apolinario (eapolinario)

07/18/2022, 7:36 PM
@Eric Hsiao, can you share the contents of
my_task.py
?
e

Eric Hsiao

07/18/2022, 7:57 PM
Copy code
@task
def is_remote(remote: bool):
    print(f"is remote: {remote}")


@workflow
def download(remote: bool = False):
    is_remote(remote=remote)
y

Yee

07/18/2022, 7:58 PM
yeah see comment in the gist
e

Eduardo Apolinario (eapolinario)

07/18/2022, 8:02 PM
this is interesting. I just tried this exact task+workflow locally (https://gist.github.com/eapolinario/93c7c004e3051dae382ffcc137519211) and it worked. Can you double-check the python version and also flytekit version you're running?
e

Eric Hsiao

07/18/2022, 8:53 PM
hey sorry I just stepped out. Let me check now
I'm using python 3.9.9 for that. The flyte versions are all the same
Copy code
➜  symphony_hall git:(main) ✗ pip freeze | grep flyte
flyteidl==1.1.9
flytekit==1.1.0
trying python 3.10.4 to see if that makes a difference
Yeah it seems like the issue happens on the older version of python. I'll have to work around that for now. Thank you for your help :)
y

Yee

07/18/2022, 9:15 PM
which version of python were you using?
e

Eric Hsiao

07/18/2022, 9:17 PM
I was using python 3.9.9
y

Yee

07/18/2022, 9:17 PM
Copy code
$ python --version
Python 3.9.13
that’s what i was using.
e

Eduardo Apolinario (eapolinario)

07/18/2022, 9:59 PM
there something weird going on, 3.9.9 is not that old (it came out in Nov-21). I also tried to repro this locally using that version, but I couldn't.
e

Eric Hsiao

07/19/2022, 10:43 PM
circling back, I bumped my local version of click which was pinned from another dependency and then that resolved the issue. Didn't need to bump the python version or anything
🚀 2
g

George Odette

07/20/2022, 8:19 AM
HI @Eric Hsiao I am trying to follow what you did here. I am experiencing the same problem with a workflow. All my boolean are failing. What did you do again?
e

Eric Hsiao

07/20/2022, 7:35 PM
@George Odette I had my version of "click" pinned with another dependency at 7.1.1 so I upgraded it to the latest version
Copy code
pip install -U click
73 Views