Thread
#flytekit
    Jay Ganbat

    Jay Ganbat

    4 months ago
    Hi all, so in previous flytekit i was able to get the workflow version by using this command
    from flytekit.configuration import internal as flyte_internal
    
    "workflow_version": flyte_internal.VERSION.get(),
    this will give me the registered workflow version but looks like the 1.0.x update removed that field, is there any other place i can get this information inside the task
    Ketan (kumare3)

    Ketan (kumare3)

    4 months ago
    why do you want this inside the task?
    Jay Ganbat

    Jay Ganbat

    4 months ago
    im logging the workflow version in a separate json file
    execution params has most information
    i think it is easy to add the version
    cc @Eduardo Apolinario (eapolinario) / @Yee
    Jay Ganbat

    Jay Ganbat

    4 months ago
    ohh nice, so it is set as env variable
    Ketan (kumare3)

    Ketan (kumare3)

    4 months ago
    ya but we trie to send everything in execution_params
    please dont use env var
    this will help us do a lot of cool optimziations in the future
    Jay Ganbat

    Jay Ganbat

    4 months ago
    execution_param? so where would that be imported from
    is it in the current_context
    Ketan (kumare3)

    Ketan (kumare3)

    4 months ago
    yup
    Jay Ganbat

    Jay Ganbat

    4 months ago
    is there a doc on the available attributes, i tried accessing the attrs field but getting an error 😞
    handle.write(str(current_context().attrs) + "\n")
          File "/fn/lib/python3.9/site-packages/flytekit/core/context_manager.py", line 261, in __getattr__
            raise AssertionError(f"{attr_name} not available as a parameter in Flyte context - are you in right task-type?")
    Ketan (kumare3)

    Ketan (kumare3)

    4 months ago
    attrs are dynamic attributes and are plugin dependent
    you want workflow version
    that does not exist
    only task version does
    Jay Ganbat

    Jay Ganbat

    4 months ago
    ok so to get the task version it should be something liek this right
    current_context().get("flyte_internal_task_version")
    i tried bunch of them but none of them seem to exist
    flyte_internal_task_version
    flyte_task_version
    task_version
    version
    Yee

    Yee

    4 months ago
    hey
    what’s
    current_context
    ?
    like how did you import that?
    Jay Ganbat

    Jay Ganbat

    4 months ago
    I used ‘from flytekit import current_context’
    Yee

    Yee

    4 months ago
    k
    so that will give you the
    ExecutionParameters
    object
    ketan was actually just referring to the environment variables… which will need to be in all-caps. those variables are not in the object itself yet.
    incidentally i was just working on this PR yesterday
    so after this it will be in that object, under the
    task_id
    property
    this will go out at 1.1.0
    Jay Ganbat

    Jay Ganbat

    4 months ago
    Oh I see so it's not there yet gotcha
    Yeah I'm testing out the 1.0 version now, when do you think 1.1 would be out
    Ketan (kumare3)

    Ketan (kumare3)

    4 months ago
    Ya lets not use env vars please
    Yee

    Yee

    4 months ago
    soon… in the next couple of weeks?
    i think we’re still trying to stick to our mostly monthly cadence.
    Jay Ganbat

    Jay Ganbat

    4 months ago
    Great thank you 🙏
    j

    jeev

    4 months ago
    thanks @Ketan (kumare3) and @Yee!