Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_env keyword not mentioned in the documentation #1656

Open
FredericoCoelhoNunes opened this issue Oct 6, 2021 · 4 comments
Open

_env keyword not mentioned in the documentation #1656

FredericoCoelhoNunes opened this issue Oct 6, 2021 · 4 comments

Comments

@FredericoCoelhoNunes
Copy link

The Github repo links to this documentation: https://docs.digdag.io/

However, the _env keyword is not mentioned there. It is, however, mentioned here: https://docs.treasuredata.com/display/public/PD/How+to+use+Secrets+in+Custom+Scripts

Which is the most updated documentation page?

@hiroyuki-sato
Copy link
Contributor

Hello, @FredericoCoelhoNunes

Thank you for reporting that.
It is the best time to contribute to this project!
Let's create PR.
https://github.com/treasure-data/digdag/blob/master/digdag-docs/src/operators/sh.md

As far as I know, sh>, py>, and rb> operator supports the_env option.

@FredericoCoelhoNunes
Copy link
Author

Hello @hiroyuki-sato ,

thanks for replying. I didn't understand if you were asking me to create the PR, but I don't think I have the availability to do that; besides, I am not even 100% sure how the _env keyword works internally, nor do I know what is the relationship between the DigDag and the Treasure Data documentation . I wouldn't feel adequately prepared to make a contribution!

@hiroyuki-sato
Copy link
Contributor

Hello, @FredericoCoelhoNunes

  • Managed Digdag in Treasure Data = Treasure Workflow. (It is the biggest Digdag user and maintainer in the world.)
  • Digdag also supports _env option.

Could you try the following example?

_export:
  myapp:
    key1: val1

+task1:
  sh>: env
  _env:
    myapp_key1: ${myapp.key1}
myapp={"key1":"val1"} # export inplicitly from _export part. It is an unuseful data layout for use in a shell.
myapp_key1=val1       # define explicitly in _env section.

You also use _env: option in py> and rb> operators

@FredericoCoelhoNunes
Copy link
Author

@hiroyuki-sato yep, that is how I've seen it being used in the past. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants