Hi all! I'm running into an issue where I'm trying...
# announcements
e
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
what is the remote flag here supposed to do btw?
and can you try with
--remote false
e
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
hmm
having trouble reproing this
still working on a gist one sec
running this (just locally) and it seems to work for me
e
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
@Eric Hsiao, can you share the contents of
my_task.py
?
e
Copy code
@task
def is_remote(remote: bool):
    print(f"is remote: {remote}")


@workflow
def download(remote: bool = False):
    is_remote(remote=remote)
y
yeah see comment in the gist
e
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
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
which version of python were you using?
e
I was using python 3.9.9
y
Copy code
$ python --version
Python 3.9.13
that’s what i was using.
e
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
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
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
@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
159 Views